@Test
public void retrieveObjectsForPageableOutOfRange() {

    PetEntity petEntity1 = new PetEntity();
    petEntity1.setName("browny");
    petEntity1.setOwner("dodong");
    PetEntity petEntity2 = new PetEntity();
    petEntity2.setName("asol");
    petEntity2.setOwner("gerry");
    when(queryService.getTypedQuery(PetEntity.class, Sort.sort(PetEntity.class), entityManager)).thenReturn(query);
    when(query.getResultList()).thenReturn(List.of(petEntity2, petEntity1));
    Page<PetEntity> all = target.findAll(PageRequest.of(2, 10));
    assertThat(all, is(notNullValue()));
    assertThat(all.getSize(), is(10));
}