docs: @SuppressWarnings( "unchecked" )
      protected List<ImportMetadata> createImportMetadata( CompilationUnit unit ) {
          List<ImportMetadata> metadata = new ArrayList<ImportMetadata>();
          List<ImportDeclaration> imports = unit.imports();
          if (!imports.isEmpty()) {
              for (ImportDeclaration importDeclaration : imports) {
                  if (importDeclaration.isOnDemand()) {
                      // typeImportOnDemand and staticImportOnDemand
                      metadata.add(ImportMetadata.onDemand(JavaMetadataUtil.getName(importDeclaration.getName())));
                  } else {
                      // singleTypeImport and singleStaticImport
                      metadata.add(ImportMetadata.single(JavaMetadataUtil.getName(importDeclaration.getName())));
                  }
              }
          }
          return metadata;
      }