### Question:
DefaultTagService implements TagService { @Override public SearchResult<Tag> getAll() { final int count = repository.getCountAll(); final List<Tag> tags = repository.getAll(); return new SearchResult<Tag>(tags, count); } @Autowired  DefaultTagService(TagRepository repository); @Override Tag getTagById(String entityId); @Override List<Tag> getAllTagsList(); @Override SearchResult<Tag> getAll(); @Override SearchResult<Tag> getLimitedList(int offset, int pageSize); @Override Tag getTagByKeyword(String keyword); @Override @Transactional Tag save(Tag tag);  }### Answer:
@Test public void getAll() { List<Tag> tags = new ArrayList<Tag>(); expect(repository.getCountAll()).andReturn(1); expect(repository.getAll()).andReturn(tags); replay(repository); List<Tag> result = service.getAll().getResultSet(); assertThat(result, is(sameInstance(tags))); verify(repository); }