public Collection<Group> getPublicSharedGroups() {
        return GroupManager.getInstance().getPublicSharedGroups();
    }
Returns the list of shared groups whose visibility is public.

@return the list of shared groups whose visibility is public.
xmppserver/src/main/java/org/jivesoftware/openfire/roster/RosterManager.java