### Question:
MongoDbCategoryRepository implements CategoryRepository { @Override public int getCountAll() { return (int) template.count(new Query(), CLASS); }  @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 getCountAll_Valid(){ long doubleOseven = 007; expect(template.count(new Query(), categoryRepository.CLASS)).andReturn(doubleOseven); replay(template); assertThat((int)doubleOseven, is(sameInstance(categoryRepository.getCountAll()))); }