### Question:
MongoDbPageLayoutRepository implements PageLayoutRepository { @Override public List<PageLayout> getAll() { return CollectionUtils.<PageLayout>toBaseTypedList(template.findAll(CLASS, PAGE_LAYOUT_COLLECTION)); }  @Override PageLayout getByPageLayoutCode(String codename); @Override List<PageLayout> getAll(); @Override List<PageLayout> getLimitedList(int offset, int limit); @Override int getCountAll(); @Override List<PageLayout> getAllUserSelectable(); @Override Class<? extends PageLayout> getType(); @Override PageLayout get(String id); @Override PageLayout save(PageLayout item); @Override void delete(PageLayout item); void setTemplate(MongoOperations template); static final Class<MongoDbPageLayout> CLASS; }### Answer:
@Test public void getAll_Valid() { List<MongoDbPageLayout> found = new ArrayList<MongoDbPageLayout>(); expect(template.findAll(pageLayoutRepository.CLASS, CollectionNames.PAGE_LAYOUT_COLLECTION)).andReturn(found); replay(template); assertThat(pageLayoutRepository.getAll(), is(sameInstance(CollectionUtils.<PageLayout>toBaseTypedList(found)))); }