@Override
        public boolean add(JID user) {
            // Do nothing if the provider is read-only.
            if (provider.isReadOnly()) {
                return false;
            }

            user = user.asBareJID();

            // Find out if the user was already a group user.
            boolean alreadyGroupUser;
            if (adminCollection) {
                alreadyGroupUser = members.contains(user);
            }
            else {
                alreadyGroupUser = administrators.contains(user);
            }
            if (users.add(user)) {
                if (alreadyGroupUser) {
                    try {
                        // Update the group user privileges in the backend store.
                        provider.updateMember(name, user, adminCollection);
                    } catch (Exception e) {
                        Log.error("Failed to update group member", e);
                    }
                }
                else {
                    try {
                        // Add the group user to the backend store.
                        provider.addMember(name, user, adminCollection);
                    } catch (Exception e) {
                        Log.error("Failed to add group member", e);
                    }
                }

                // Perform post-processing (cache updates and event notifications).
                if (adminCollection) {
                    groupManager.adminAddedPostProcess(Group.this, user, alreadyGroupUser);
                } else {
                    groupManager.memberAddedPostProcess(Group.this, user, alreadyGroupUser);
                }

                return true;
            }
            return false;
        }
Returns an iterator over the users in this collection.

The returned iterator is <i>weakly consistent</i>.

@return an iterator over the users in this collection
xmppserver/src/main/java/org/jivesoftware/openfire/group/Group.java