public Collection<Group> search(String query) {
        Collection<String> groupNames = provider.search(query);
        return new GroupCollection(groupNames);
    }
Returns the groups that match the search. The search is over group names and
implicitly uses wildcard matching (although the exact search semantics are left
up to each provider implementation). For example, a search for "HR" should match
the groups "HR", "HR Department", and "The HR People".<p>

Before searching or showing a search UI, use the {@link #isSearchSupported} method
to ensure that searching is supported.

@param query the search string for group names.
@return all groups that match the search.
xmppserver/src/main/java/org/jivesoftware/openfire/group/GroupManager.java