createFourArtistsAndTwoPaintings();
String ejbql = "SELECT COUNT(p), a, a.artistName "
+ "FROM Painting p INNER JOIN p.toArtist a GROUP BY a, a.artistName "
+ "ORDER BY a.artistName";
EJBQLQuery query = new EJBQLQuery(ejbql);
List<?> data = context.performQuery(query);
assertEquals(2, data.size());
assertTrue(data.get(0) instanceof Object[]);