Element () { Element state = new Element("state"); if (myDisabledHintsFiles.isEmpty()) { return state; } List<String> array = new ArrayList<>(myDisabledHintsFiles.size()); for (VirtualFile file : myDisabledHintsFiles) { if (file.isValid()) { array.add(file.getUrl()); } } if (!array.isEmpty()) { Collections.sort(array); Element disableHintsElement = new Element(DISABLE_HINTS_TAG); state.addContent(disableHintsElement); for (String url : array) { disableHintsElement.addContent(new Element(FILE_TAG).setAttribute(URL_ATT, url)); } } return state; }