code: public boolean checkPackageGroups(String groupname,
              String pkgNameFormList) {
          StringTokenizer strtok = new StringTokenizer(pkgNameFormList, ":");
          if (groupList.contains(groupname)) {
              configuration.message.warning("doclet.Groupname_already_used", groupname);
              return false;
          }
          groupList.add(groupname);
          while (strtok.hasMoreTokens()) {
              String id = strtok.nextToken();
              if (id.length() == 0) {
                  configuration.message.warning("doclet.Error_in_packagelist", groupname, pkgNameFormList);
                  return false;
              }
              if (id.endsWith("*")) {
                  id = id.substring(0, id.length() - 1);
                  if (foundGroupFormat(regExpGroupMap, id)) {
                      return false;
                  }
                  regExpGroupMap.put(id, groupname);
                  sortedRegExpList.add(id);
              } else {
                  if (foundGroupFormat(pkgNameGroupMap, id)) {
                      return false;
                  }
                  pkgNameGroupMap.put(id, groupname);
              }
          }
          Collections.sort(sortedRegExpList, new MapKeyComparator());
          return true;
      }
docs: Depending upon the format of the package name provided in the "-group"
  option, generate two separate maps. There will be a map for mapping
  regular expression(only meta character allowed is '*' and that is at the
  end of the regular expression) on to the group name. And another map
  for mapping (possible) package names(if the name format doesen't contain
  meta character '*', then it is assumed to be a package name) on to the
  group name. This will also sort all the regular expressions found in the
  reverse order of their lengths, i.e. longest regular expression will be
  first in the sorted list.
  
  @param groupname       The name of the group from -group option.
  @param pkgNameFormList List of the package name formats.