@Override
    public Collection<User> getUsers( int startIndex, int numResults )
    {
        final List<User> userList = new ArrayList<>();
        int totalUserCount = 0;

        for ( final UserProvider provider : getUserProviders() )
        {
            final int providerStartIndex = Math.max( ( startIndex - totalUserCount ), 0 );
            totalUserCount += provider.getUserCount();
            if ( startIndex >= totalUserCount )
            {
                continue;
            }
            final int providerResultMax = numResults - userList.size();
            userList.addAll( provider.getUsers( providerStartIndex, providerResultMax ) );
            if ( userList.size() >= numResults )
            {
                break;
            }
        }
        return userList;
    }
Returns the 'backing' provider that serves the provided user. Note that the user need not exist.

Finds a suitable UserProvider for the user.

Note that the provided username need not reflect a pre-existing user (the instance might be used to determine in
which provider a new user is to be created).

Implementations are expected to be able to find a UserProvider for any username. If an implementation fails to do
so, such a failure is assumed to be the result of a problem in implementation or configuration.

@param username A user identifier (cannot be null or empty).
@return A UserProvider for the user (never null).
xmppserver/src/main/java/org/jivesoftware/openfire/user/UserMultiProvider.java