@Override
        public User next() throws java.util.NoSuchElementException {
            User element;
            if (nextElement != null) {
                element = nextElement;
                nextElement = null;
            }
            else {
                element = getNextElement();
                if (element == null) {
                    throw new NoSuchElementException();
                }
            }
            return element;
        }
Constructs a new UserCollection.
@param elements the initial set of users
xmppserver/src/main/java/org/jivesoftware/openfire/user/UserCollection.java