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