code: private void removeEmptyGroups() {
          // We have to do this because RosterGroup.removeEntry removes the entry immediately
          // (locally) and the group could remain empty.
          // TODO Check the performance/logic for rosters with large number of groups
          for (RosterGroup group : getGroups()) {
              if (group.getEntryCount() == 0) {
                  groups.remove(group.getName());
              }
          }
      }
docs: Removes all the groups with no entries.
  
  This is used by {@link RosterPushListener} and {@link RosterResultListener} to
  cleanup groups after removing contacts.