@Test(expected = UnexpectedInvocation.class)
  public void verifyAllWithUnverifiedReplayOnSameInstance(final Dependency mock2) {
    mock.editABunchMoreStuff();
    mock2.editABunchMoreStuff();

    new FullVerifications(mock2) {
      {
        mock.editABunchMoreStuff();
      }
    };
  }
  @Test
  public void importLocalMocksFromPreviousExpectationsBlock() {
    Expectations exp =
        new Expectations() {
          @NonStrict Dependency mockDependency;

          @Mocked("run")
          @Capturing
          Runnable runnable;
        };

    dependency.editABunchMoreStuff();
    new Runnable() {
      public void run() {}
    }.run();

    new FullVerifications() {
      Runnable runnable;
      Dependency mock;

      {
        runnable.run();
        times = 1;
        mock.editABunchMoreStuff();
      }
    };
  }
  @Test(expected = MissingInvocation.class)
  public void verifyAllWithReplayOnDifferentInstanceWhenShouldBeSame(final Dependency mock2) {
    mock2.editABunchMoreStuff();

    new FullVerificationsInOrder(mock2) {
      {
        mock.editABunchMoreStuff();
      }
    };
  }
  @Test
  public void verifyAllInvocationsWithReplayOnSameInstance(final Dependency mock2) {
    mock2.editABunchMoreStuff();

    new FullVerifications(mock2) {
      {
        mock2.editABunchMoreStuff();
      }
    };
  }
  @Test
  public void verifyNoInvocationsOccurredOnMockedDependencyWithOneHavingOccurred(
      AnotherDependency mock2) {
    mock2.doSomething();
    mock.editABunchMoreStuff();

    try {
      new FullVerifications(mock) {};
      fail();
    } catch (UnexpectedInvocation e) {
      assertTrue(e.getMessage().contains("editABunchMoreStuff()"));
    }
  }
  @Test
  public void verifyStaticInvocationForSpecifiedMockInstance(final AnotherDependency mock2) {
    mock2.doSomething();
    AnotherDependency.staticMethod();
    mock2.doSomethingElse(1);
    mock.editABunchMoreStuff();
    mock2.doSomethingElse(2);

    new FullVerificationsInOrder(mock2) {
      {
        mock2.doSomething();
        AnotherDependency.staticMethod();
        mock2.doSomethingElse(anyInt);
        mock2.doSomethingElse(anyInt);
      }
    };
  }
  @Test
  public void importLocalMockFromPreviousNonStrictExpectationsBlock() {
    new NonStrictExpectations() {
      Dependency mock;

      {
        mock.notifyBeforeSave();
        result = true;
      }
    };

    dependency.editABunchMoreStuff();
    assertTrue(dependency.notifyBeforeSave());

    new Verifications() {
      Dependency mock;

      {
        mock.editABunchMoreStuff();
      }
    };
  }
 private void exerciseCodeUnderTest() {
   mock.prepare();
   mock.setSomething(123);
   mock.editABunchMoreStuff();
   mock.save();
 }