### Question:
MongoDbGroupRepository implements GroupRepository { @Override public Group findByTitle(String title) { return template.findOne(query(where("title").is(title))); }  @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 getByTitle() { String title = "title"; Group group = new GroupImpl(); group.setId("1"); group.setTitle(title); expect(groupTemplate.findOne(Query.query(Criteria.where("title").is(title)))).andReturn(group); replay(groupTemplate); Group fromRepo = repo.findByTitle(title); assertThat(fromRepo.getTitle(), is(equalTo(title))); }