AbstractUrl (Object element) { if (element instanceof NamedLibraryElement libraryElement) { Module context = libraryElement.getModule(); return new NamedLibraryUrl(libraryElement.getOrderEntry().getPresentableName(), context != null ? context.getName() : null); } return null; }