ItemBuilder { public Element build() { FacetResult dimensionResult = getTopChildren(); Element dimensionElement = buildDimensionElement(dimensionResult); if (dimensionResult != null) { addResultSubCategoriesToElement(dimensionResult, dimensionElement); } return dimensionElement; } ItemBuilder(ItemConfig config, String langCode, Facets facets, Format format); Element build(); @Override String toString();  }
@Test public void testItemBuild() throws JDOMException, IOException { ItemConfig itemConfig = buildKeywordTokenItemConfig(); Facets facets = buildFacets(); ItemBuilder builder = new ItemBuilder(itemConfig, "eng", facets, Format.DIMENSION); Element summary = builder.build(); assertEquals(loadExpectedResult("itemBuild.xml"), Xml.getString(summary)); }