//使用迭代器循环去除已经是群成员的好友,同时去除不是互相关注的好友
List<FriendDto> dtos= friendDtos.getData();
Iterator<FriendDto> friends = dtos.iterator();
while(friends.hasNext()){
FriendDto friendDto = friends.next();
Long fuserId = friendDto.getFocusUserId();
for (int i = 0; i < chatGroupMemberDtos.size(); i++) {
ChatGroupMemberDto chatGroupMemberDto = chatGroupMemberDtos.get(i);
if (chatGroupMemberDto.getUserId().equals(fuserId)) {
friends.remove();
result.setTotalCount(result.getTotalCount()-1);
}
}
if (friendDto.getStatus() != 2) {
friends.remove();
result.setTotalCount(result.getTotalCount()-1);
}
}