LibraryType (@NotNull LibraryKind kind) { for (LibraryType<?> type : EP_NAME.getExtensions()) { if (type.getKind() == kind) { return type; } } if (kind instanceof UnknownLibraryKind) { return new UnknownLibraryType((UnknownLibraryKind)kind); } throw new IllegalArgumentException("Library with kind " + kind + " is not registered"); }