HeaderImpl extends XliffElementImpl implements Header { @Override public List<? extends Element> getChildren() { ArrayList<Element> ret = new ArrayList<Element>(); if (skl != null) { ret.add(skl); } if (phaseGroup != null) { ret.add(phaseGroup); } ret.addAll(context); ret.addAll(nonXliffElements); return ret; } HeaderImpl();  HeaderImpl(org.w3c.dom.Element element); @Override List<? extends Element> getChildren(); List<? extends Context> getContext(); List<NonXliffElement> getNonXliffElements(); PhaseGroup getPhaseGroup(); Skl getSkl(); void setContext(List<? extends Context> context); void setNonXliffElements(List<NonXliffElement> nonXliffElements); void setPhaseGroup(PhaseGroup phaseGroup); void setSkl(Skl skl);  }
@Test public void testGetChildren() { HeaderImpl header = new HeaderImpl(); header.setSkl(createDefaultSkl()); header.setPhaseGroup(createDefaultPhaseGroup()); ArrayList<Header.Context> context = new ArrayList<Header.Context>(); context.add(createDefaultGlossary()); context.add(createDefaultReference()); context.add(createDefaultCountGroup()); context.add(createDefaultPropGroup()); context.add(createDefaultNote()); context.add(createDefaultTool()); header.setContext(context); ArrayList<NonXliffElement> nxes = new ArrayList<NonXliffElement>(); nxes.add(createDefaultNonXliffElement()); header.setNonXliffElements(nxes); List<? extends com.sap.mlt.xliff12.api.base.Element> children = header .getChildren(); assertEquals(new Integer(9), new Integer(children.size())); }