}
public void incorrectUseOfApi() {
throw new MockitoException(join(
"Incorrect use of API detected here:",
new LocationImpl(),
"",
"You probably stored a reference to OngoingStubbing returned by when() and called stubbing methods like thenReturn() on this reference more than once.",
"Examples of correct usage:",
" when(mock.isOk()).thenReturn(true).thenReturn(false).thenThrow(exception);",
" when(mock.isOk()).thenReturn(true, false).thenThrow(exception);",