MemoryPageStore extends BaseEntityMemoryStore<Page> implements PageStore { @Override public List<Page> findAllRootPages() { return FluentIterable.from(all()).filter(withParent(null)).toList(); }  @Override Page findBySlug(String slug); @Override List<Page> findAllRootPages();  }
@Test public void testFindRootPages() throws InvalidEntityException, EntityAlreadyExistsException { Page page1 = pageStore.create(new Page()); Page page2 = new Page(); page2.setParentId(page1.getId()); page2 = pageStore.create(page2); Page page3 = new Page(); page3.setParentId(page1.getId()); page3 = pageStore.create(page3); Page page4 = pageStore.create(new Page()); Assert.assertEquals(2, pageStore.findAllRootPages().size()); Assert.assertTrue(pageStore.findAllRootPages().contains(page1)); Assert.assertTrue(pageStore.findAllRootPages().contains(page4)); }