@Test public void testSteal() { final StealingMethod method = mock(StealingMethod.class); final HalflingThief thief = new HalflingThief(method); thief.steal(); verify(method).steal(); verifyNoMoreInteractions(method); }
public void steal() { method.steal(); }
HalflingThief { public void steal() { method.steal(); } }
HalflingThief { public void steal() { method.steal(); } HalflingThief(StealingMethod method); }
HalflingThief { public void steal() { method.steal(); } HalflingThief(StealingMethod method); void steal(); void changeMethod(StealingMethod method); }
HalflingThief { public void steal() { method.steal(); } HalflingThief(StealingMethod method); void steal(); void changeMethod(StealingMethod method);  }