ContextGroupImpl extends XliffElementImpl implements ContextGroup { public List<Context> getContexts() { return Collections.unmodifiableList(contexts); } ContextGroupImpl(List<Context> contexts);  ContextGroupImpl(org.w3c.dom.Element element); @Override List<? extends Node> getChildren(); Name getContextGroupName(); List<Context> getContexts(); Crc getCrc(); Purpose getPurpose(); void setContextGroupName(Name name); void setContexts(List<Context> contexts); void setCrc(Crc crc); void setPurpose(Purpose purpose);  }
@Test public void testContextGroupImplListOfContext() { ContextGroupImpl cg = createDefaultContextGroup(); assertEquals(createDefaultContexts(), cg.getContexts()); }
@Test public void testContextGroupImplElement() { Document doc = Utils.createDocument(); Element elem = doc.createElementNS(XLIFF_12_NAMESPACE, "context-group"); try { new ContextGroupImpl(elem); fail("Expected ConstraintViolationException"); } catch (ConstraintViolationException e) { } elem.appendChild(createDefaultContext().asXmlNode(doc)); try { ContextGroupImpl cg = new ContextGroupImpl(elem); assertEquals(createDefaultContexts(), cg.getContexts()); } catch (ConstraintViolationException e) { fail("Did not expect ConstraintViolationException"); } elem.appendChild(doc.createElementNS("ns", "name")); try { new ContextGroupImpl(elem); fail("Expected ConstraintViolationException"); } catch (ConstraintViolationException e) { } }