code: public Map<String,String> getPubapis() {
          Map<String,String> publicApiPerPackage = new HashMap<String,String>();
          if (publicApiPerClass == null) return publicApiPerPackage;
          Name[] keys = publicApiPerClass.keySet().toArray(new Name[0]);
          Arrays.sort(keys, new CompareNames());
          StringBuffer newPublicApi = new StringBuffer();
          int i=0;
          String prevPkg = "";
          for (Name k : keys) {
              String cn = k.toString();
              String pn = "";
              int dp = cn.lastIndexOf('.');
              if (dp != -1) {
                  pn = cn.substring(0,dp);
              }
              if (!pn.equals(prevPkg)) {
                  if (!prevPkg.equals("")) {
                      // Add default module name ":"
                      publicApiPerPackage.put(":"+prevPkg, newPublicApi.toString());
                  }
                  newPublicApi = new StringBuffer();
                  prevPkg = pn;
              }
              newPublicApi.append(publicApiPerClass.get(k));
              i++;
          }
          if (!prevPkg.equals(""))
              publicApiPerPackage.put(":"+prevPkg, newPublicApi.toString());
          return publicApiPerPackage;
      }
docs: Convert the map from class names to their pubapi to a map
  from package names to their pubapi (which is the sorted concatenation
  of all the class pubapis)