docs: static PackageInfo getOrCreatePackage(final String packageName,
              final Map<String, PackageInfo> packageNameToPackageInfo) {
          // Get or create PackageInfo object for this package
          PackageInfo packageInfo = packageNameToPackageInfo.get(packageName);
          if (packageInfo != null) {
              // PackageInfo object already exists for this package
              return packageInfo;
          }
  
          // Create new PackageInfo for this package
          packageNameToPackageInfo.put(packageName, packageInfo = new PackageInfo(packageName));
  
          // If this is not the root package ("")
          if (!packageName.isEmpty()) {
              // Recursively create PackageInfo objects for parent packages (until a parent package that already
              // exists is reached), and connect each ancestral package to its parent
              final PackageInfo parentPackageInfo = getOrCreatePackage(getParentPackageName(packageInfo.name),
                      packageNameToPackageInfo);
              if (parentPackageInfo != null) {
                  // Link package to parent
                  if (parentPackageInfo.children == null) {
                      parentPackageInfo.children = new HashSet<>();
                  }
                  parentPackageInfo.children.add(packageInfo);
                  packageInfo.parent = parentPackageInfo;
              }
          }
  
          // Return the newly-created PackageInfo object
          return packageInfo;
      }