void (Element element) { final List<Library> libraries = ContainerUtil.sorted(ContainerUtil.findAll(myLibraries, library -> !((LibraryEx)library).isDisposed()), // todo: do not sort if project is directory-based (o1, o2) -> StringUtil.compare(o1.getName(), o2.getName(), true)); for (final Library library : libraries) { if (library.getName() != null) { library.writeExternal(element); } } }