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