private User getNextElement() {
            while (currentIndex + 1 < elements.length) {
                currentIndex++;
                User element = null;
                try {
                    element = UserManager.getInstance().getUser(elements[currentIndex]);
                }
                catch (UserNotFoundException unfe) {
                    // Ignore.
                }
                if (element != null) {
                    return element;
                }
            }
            return null;
        }
Returns the next available element, or null if there are no more elements to return.

@return the next available element.
xmppserver/src/main/java/org/jivesoftware/openfire/user/UserCollection.java