@Test public void testConfirmDoReturnChain(){ String a = "a"; String b = "b"; OverrideToString obj = mock(OverrideToString.class); doReturn(a).doReturn(b).when(obj).toString(); assertEquals(a, obj.toString()); assertEquals(b, obj.toString()); assertEquals(b, obj.toString()); assertEquals(b, obj.toString()); }
public static Stubber doReturn(Object value, Object... values){ Stubber stubber = Mockito.doReturn(value); for(Object v : values){ stubber = stubber.doReturn(v); } return stubber; }
MockitoExtension { public static Stubber doReturn(Object value, Object... values){ Stubber stubber = Mockito.doReturn(value); for(Object v : values){ stubber = stubber.doReturn(v); } return stubber; } }
MockitoExtension { public static Stubber doReturn(Object value, Object... values){ Stubber stubber = Mockito.doReturn(value); for(Object v : values){ stubber = stubber.doReturn(v); } return stubber; }  }
MockitoExtension { public static Stubber doReturn(Object value, Object... values){ Stubber stubber = Mockito.doReturn(value); for(Object v : values){ stubber = stubber.doReturn(v); } return stubber; }  static Stubber doReturn(Object value, Object... values); }
MockitoExtension { public static Stubber doReturn(Object value, Object... values){ Stubber stubber = Mockito.doReturn(value); for(Object v : values){ stubber = stubber.doReturn(v); } return stubber; }  static Stubber doReturn(Object value, Object... values);  }