### Question:
MongoDbTagRepository implements TagRepository { @Override public int getCountAll() { return (int)template.count(new Query()); }  @Override List<Tag> getAll(); @Override List<Tag> getLimitedList(int offset, int pageSize); @Override int getCountAll(); @Override Tag getByKeyword(String keyword); @Override Class<? extends Tag> getType(); @Override Tag get(String id); @Override Tag save(Tag item); @Override void delete(Tag item); void setWidgetTemplate(MongoTagOperations tagTemplate);  }### Answer:
@Test public void countAll(){ expect(tagTemplate.count(new Query())).andReturn(2L); replay(tagTemplate); int result = repo.getCountAll(); assertThat(result, is(equalTo(2))); }