@Test
public void testAll() throws Exception {
assertEquals(1, todoService.findAll().size());
final Todo todo = ao.create(Todo.class);
todo.setDescription("Some todo");
todo.save();
Comment comment = ao.create(Comment.class);
comment.setTodo(todo);
comment.setText("Comment text 3");
comment.save();
comment = ao.create(Comment.class);
comment.setTodo(todo);
comment.setText("Comment text 4");
comment.save();
ao.flushAll(); // clear all caches
final List<Todo> all = todoService.findAll();
assertEquals(2, all.size());
assertEquals(todo.getID(), all.get(1).getID());
assertEquals("Comment text 3", all.get(1).getComments()[0].getText());
}