pojoEntity.setProperty("booksByIdAndAuthor", Utils.newArrayList(bookEntity3.getKey(), bookEntity2.getKey(), bookEntity1.getKey()));
pojoEntity.setProperty("booksByAuthorAndId", Utils.newArrayList(bookEntity2.getKey(), bookEntity1.getKey(), bookEntity3.getKey()));
ds.put(pojoEntity);
startEnd.start();
HasOneToManyWithOrderByJPA pojo =
em.find(pojoClass, KeyFactory.keyToString(pojoEntity.getKey()));
assertNotNull(pojo);
assertNotNull(pojo.getBooksByAuthorAndTitle());
assertEquals(3, pojo.getBooksByAuthorAndTitle().size());
assertEquals("title 2", pojo.getBooksByAuthorAndTitle().get(0).getTitle());
assertEquals("title 0", pojo.getBooksByAuthorAndTitle().get(1).getTitle());
assertEquals("title 1", pojo.getBooksByAuthorAndTitle().get(2).getTitle());
assertNotNull(pojo.getBooksByIdAndAuthor());
assertEquals(3, pojo.getBooksByIdAndAuthor().size());
assertEquals("title 0", pojo.getBooksByIdAndAuthor().get(0).getTitle());
assertEquals("title 2", pojo.getBooksByIdAndAuthor().get(1).getTitle());
assertEquals("title 1", pojo.getBooksByIdAndAuthor().get(2).getTitle());
assertNotNull(pojo.getBooksByAuthorAndId());
assertEquals(3, pojo.getBooksByAuthorAndId().size());
assertEquals("title 2", pojo.getBooksByAuthorAndId().get(0).getTitle());
assertEquals("title 1", pojo.getBooksByAuthorAndId().get(1).getTitle());
assertEquals("title 0", pojo.getBooksByAuthorAndId().get(2).getTitle());
startEnd.end();
}