Query query = hibernateQueryProvider.createQuery();
List<Foo> expectedFoos = new ArrayList<Foo>();
expectedFoos.add(new Foo(1, "bar1", 1));
expectedFoos.add(new Foo(2, "bar2", 2));
expectedFoos.add(new Foo(3, "bar3", 3));
expectedFoos.add(new Foo(4, "bar4", 4));
expectedFoos.add(new Foo(5, "bar5", 5));
@SuppressWarnings("unchecked")
List<Foo> actualFoos = query.list();
assertEquals(actualFoos, expectedFoos);