code: public static String getPackageName(Elements elementUtils, TypeElement type) throws IOException {
      PackageElement pkg = elementUtils.getPackageOf(type);
      if (!pkg.isUnnamed()) {
        return pkg.getQualifiedName().toString();
      } else {
        return ""; // Default package
      }
    }
docs: Get the Package name
  
  @throws IOException