docs: private D createAndRegisterDeclaration(Map<String, Object> metadata) {
          D declaration;
          if (klass.equals(ImportDeclaration.class)) {
              declaration = (D) ImportDeclarationBuilder.fromMetadata(metadata).build();
          } else if (klass.equals(ExportDeclaration.class)) {
              declaration = (D) ExportDeclarationBuilder.fromMetadata(metadata).build();
          } else {
              throw new IllegalStateException("");
          }
          declarationRegistrationManager.registerDeclaration(declaration);
          return declaration;
      }