void () { Element root = new Element("root"); final Element testTag = new Element("test"); testTag.setAttribute("path", "$MACRO$"); testTag.setAttribute("ignore", "$PATH$"); root.addContent(testTag); final Set<String> macros = PathMacrosCollector.getMacroNames(root, null, new PathMacrosImpl(false)); assertEquals(2, macros.size()); assertTrue(macros.contains("MACRO")); assertTrue(macros.contains("PATH")); final Set<String> filtered = PathMacrosCollector.getMacroNames(root, new PathMacroFilter() { @Override public boolean skipPathMacros(@NotNull Attribute attribute) { return "ignore".equals(attribute.getName()); } }, new PathMacrosImpl(false)); assertEquals(1, filtered.size()); assertTrue(macros.contains("MACRO")); }