### Question:
JpaPersonRepository implements PersonRepository { @Override public void removeFriend(String friendUsername, String username) { TypedQuery<JpaPersonAssociation> query = manager.createNamedQuery(JpaPersonAssociation.FIND_ASSOCIATION_ITEM_BY_USERNAMES, JpaPersonAssociation.class); query.setParameter(JpaPersonAssociation.FOLLOWER_USERNAME, username); query.setParameter(JpaPersonAssociation.FOLLOWEDBY_USERNAME, friendUsername); JpaPersonAssociation item = getSingleResult(query.getResultList()); manager.remove(item); query = manager.createNamedQuery(JpaPersonAssociation.FIND_ASSOCIATION_ITEM_BY_USERNAMES, JpaPersonAssociation.class); query.setParameter(JpaPersonAssociation.FOLLOWER_USERNAME, friendUsername); query.setParameter(JpaPersonAssociation.FOLLOWEDBY_USERNAME, username); JpaPersonAssociation inverseItem = getSingleResult(query.getResultList()); manager.remove(inverseItem); }  @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 Class<? extends Person> getType(); @Override Person get(String id); @Override Person save(Person item); @Override void delete(Person item); @Override boolean addFriend(String friendUsername, String username); @Override void removeFriend(String friendUsername, String username); @Override HashMap<String, List<Person>> findFriendsAndRequests(String username); @Override List<Person> findFriendRequestsSent(String username); @Override List<Person> findFriendRequestsReceived(String username); @Override boolean acceptFriendRequest(String friendUsername, String username); @Override int removeAllFriendsAndRequests(String userid); @Override List<Person> getAll(); @Override List<Person> getLimitedList(int offset, int limit); @Override int getCountAll();  }### Answer:
@Test @Transactional(readOnly=false) @Rollback(true) public void removeFriend() { List<Person> friends = repository.findFriends(VALID_USER); assertThat(friends.size(), is(equalTo(3))); assertThat(friends.get(0).getUsername(), is(equalTo(VALID_USER2))); assertThat(friends.get(1).getUsername(), is(equalTo(VALID_USER3))); assertThat(friends.get(2).getUsername(), is(equalTo(VALID_USER4))); repository.removeFriend(VALID_USER4, VALID_USER); friends = repository.findFriends(VALID_USER); assertThat(friends.size(), is(equalTo(2))); assertThat(friends.get(0).getUsername(), is(equalTo(VALID_USER2))); assertThat(friends.get(1).getUsername(), is(equalTo(VALID_USER3))); }