### Question:
MongoDbPersonRepository implements PersonRepository { @Override public List<Person> getAll() { List<User> users = template.find(new Query()); ArrayList<Person> persons= new ArrayList<Person>(); for(User user : users) { persons.add(user.toPerson()); } return persons; }  @Override Person findByUsername(String username); @Override List<Person> findAllConnectedPeople(String username); @Override List<Person> findAllConnectedPeople(String username, String appId); @Override List<Person> findAllConnectedPeopleWithFriend(String username, String friendUsername); @Override List<Person> findFriends(String username); @Override List<Person> findFriends(String username, String appId); @Override List<Person> findFriendsWithFriend(String username, String friendUsername); @Override List<Person> findByGroup(String groupId); @Override List<Person> findByGroup(String groupId, String appId); @Override List<Person> findByGroupWithFriend(String groupId, String friendUsername); @Override boolean addFriend(String friendUsername, String username); @Override void removeFriend(String friendUsername, String username); @Override HashMap<String, List<Person>> findFriendsAndRequests(String username); @Override boolean acceptFriendRequest(String friendUsername, String username); @Override List<Person> findFriendRequestsReceived(String username); @Override List<Person> findFriendRequestsSent(String username); @Override int removeAllFriendsAndRequests(String userid); @Override Class<? extends Person> getType(); @Override Person get(String id); @Override Person save(Person item); @Override void delete(Person item); void setTemplate(MongoUserOperations template); void setPageTemplate(MongoPageOperations pageTemplate); void setWidgetOperations(MongoWidgetOperations widgetOperations); @Override List<Person> getAll(); @Override List<Person> getLimitedList(int offset, int limit); @Override int getCountAll();  }### Answer:
@Test public void getAll(){ List<Person> people = new ArrayList<Person>(); List<User> users = new ArrayList<User>(); expect(template.find(isA(Query.class))).andReturn(users); replay(template); assertThat(people, is(repo.getAll())); }