code: public static String getQualifiedMainTypeName(CompilationUnit unit) {
      PackageDeclaration pkg = unit.getPackage();
      if (pkg.isDefaultPackage()) {
        return unit.getMainTypeName();
      } else {
        return pkg.getName().getFullyQualifiedName() + '.' + unit.getMainTypeName();
      }
    }
docs: Gets the fully qualified name of the main type in this compilation unit.