List<Object[]> result = q.cacheEntities(true).list(Girl2.class, Boy.class);
assertEquals(4, result.size());
Girl2 girl0 = (Girl2) result.get(0)[0];
Girl2 girl1 = (Girl2) result.get(1)[0];
Girl2 girl2 = (Girl2) result.get(2)[0];
Girl2 girl3 = (Girl2) result.get(3)[0];
assertEquals("Emma", girl0.name);
assertTrue(girl1.equals(girl2));
assertTrue(girl1 == girl2);
assertFalse(girl3 == girl1);
Boy boy0 = (Boy) result.get(0)[1];
Boy boy1 = (Boy) result.get(1)[1];
Boy boy2 = (Boy) result.get(2)[1];
Boy boy3 = (Boy) result.get(3)[1];
assertNull(boy0);
assertTrue(boy1.id != boy2.id);
assertFalse(boy1 == boy2);
assertFalse(boy2 == boy3);
assertNull(girl1.getBoys());
assertNull(girl3.getBoys());
}