void (@NotNull Element element) { final List<OrderRootType> rootTypes = sortRootTypes(myRoots.keySet()); for (OrderRootType rootType : rootTypes) { VirtualFilePointerContainer container = myRoots.get(rootType); List<Pair<String, Boolean>> jarDirectories = new ArrayList<>(container.getJarDirectories()); jarDirectories.sort(Comparator.comparing(p -> p.getFirst(), String.CASE_INSENSITIVE_ORDER)); for (Pair<String, Boolean> pair : jarDirectories) { String url = pair.getFirst(); boolean isRecursive = pair.getSecond(); final Element jarDirElement = new Element(VirtualFilePointerContainerImpl.JAR_DIRECTORY_ELEMENT); jarDirElement.setAttribute(VirtualFilePointerContainerImpl.URL_ATTR, url); jarDirElement.setAttribute(VirtualFilePointerContainerImpl.RECURSIVE_ATTR, Boolean.toString(isRecursive)); if (!rootType.equals(DEFAULT_JAR_DIRECTORY_TYPE)) { jarDirElement.setAttribute(ROOT_TYPE_ATTR, rootType.name()); } element.addContent(jarDirElement); } } }