I can be the implementation of a chat app to show users chat only the can get user_id to be sent or receive a message to store in user-list and select the user to be added in the list some error like a User list if added user 1 and add user 2 when and user 1 again the exception in ArrayList
for (String id : usersList)
if (equal(user.getId(), id)) {
if (mUseres.size() != 0) {
for (User user1 : mUseres) {
if (!equal(user.getId(), user1.getId())) {
mUseres.add(user);
}
}
} else {
mUseres.add(user);
}