mockito mock resultscanner code example Example: mockito mock resultset Mockito.when(resultSetMock.next()).thenReturn(true).thenReturn(false);