### Question:
MongoDbCategoryRepository implements CategoryRepository { @Override public List<Category> getAll() { return CollectionUtils.<Category>toBaseTypedList(hydrate(template.findAll(CLASS, CATEGORY_COLLECTION))); }  @Override List<Category> getAll(); @Override List<Category> getLimitedList(int offset, int limit); @Override int getCountAll(); @Override int removeFromCreatedOrModifiedFields(String userId); @Override Class<? extends Category> getType(); @Override Category get(String id); @Override Category save(Category item); @Override void delete(Category item); void setTemplate(MongoOperations template); void setConverter(HydratingConverterFactory converter); static final Class<MongoDbCategory> CLASS; }### Answer:
@Test public void getAll(){ List<MongoDbCategory> categories = new ArrayList<MongoDbCategory>(); expect(template.findAll(categoryRepository.CLASS, CollectionNames.CATEGORY_COLLECTION)).andReturn(categories); replay(template); assertThat(CollectionUtils.<Category>toBaseTypedList(categories), is(sameInstance(categoryRepository.getAll()))); }