List<String> (@NotNull String namespaceKey, @NotNull XmlFile file) { final NotNullFunction<XmlTag, List<String>> function = myNamespacePolicies.get(namespaceKey); if (function instanceof ConstantFunction) { return function.fun(null); } if (function != null) { final XmlDocument document = file.getDocument(); if (document != null) { final XmlTag tag = document.getRootTag(); if (tag != null) { return function.fun(tag); } } } else { return Collections.singletonList(namespaceKey); } return Collections.emptyList(); }