code: private boolean hasPrintedPackageIndex(PackageElement pkg) {
          for (PackageElement printedPkg : printedPackageHeaders) {
              if (utils.getPackageName(pkg).startsWith(utils.parsePackageName(printedPkg))) {
                  return true;
              }
          }
          return false;
      }
docs: Return true if the given package name has been printed.  Also
  return true if the root of this package has been printed.
  
  @param pkgname the name of the package to check.