### Question:
MongoDbGroupRepository implements GroupRepository { @Override public List<Group> getAll() { return template.find(new Query()); }  @Override Group findByTitle(String title); @Override Class<? extends Group> getType(); @Override Group get(String id); @Override List<Group> getAll(); @Override List<Group> getLimitedList(int offset, int limit); @Override int getCountAll(); @Override Group save(Group item); @Override void delete(Group item); void setTemplate(MongoGroupOperations template);  }### Answer:
@Test public void getAll() { List<Group> groups = Arrays.<Group>asList(new GroupImpl(), new GroupImpl()); expect(groupTemplate.find(new Query())).andReturn(groups); replay(groupTemplate); List<Group> result = repo.getAll(); assertNotNull(result); assertThat(result.size(), is(equalTo(groups.size()))); }