MethodsImpl methods = mock(MethodsImpl.class);
doReturn("A").doCallRealMethod()
.when(methods).simpleMethod();
assertEquals("A", methods.simpleMethod());
assertEquals(null, methods.simpleMethod());
}
@Test(expected = IllegalArgumentException.class)
public void shouldAllowChainedStubbingWithExceptionClass() throws Exception {
doReturn("whatever").doThrow(IllegalArgumentException.class).when(mock).simpleMethod();