Library (final Library library, LibrariesModifiableModel tableModel) { if (tableModel == null) return library; if (tableModel.wasLibraryRemoved(library)) return null; return tableModel.hasLibraryEditor(library) ? (Library)tableModel.getLibraryEditor(library).getModel() : library; }