void (String sourceData, String expectedData) { configureFromFileText("test." + getExtension(), sourceData); HashMap<String, String> attribute2value = new HashMap<>(); TemplateToken templateToken = new TemplateToken("div", attribute2value); templateToken.setTemplateText(sourceData, getFile()); XmlTag tag = templateToken.getXmlTag(); if (tag != null) { for (XmlAttribute attribute : tag.getAttributes()) { attribute2value.put(attribute.getName(), attribute.getValue()); } } String filteredData = getFilter().filterText(sourceData, templateToken); assertEquals(expectedData, filteredData); }