Syntax extends AbstractSchemaElement { public static Syntax parse(final String definition) throws ParseException { final Matcher m = DEFINITION_PATTERN.matcher(definition); if (!m.matches()) { throw new ParseException("Invalid attribute syntax definition: " + definition, definition.length()); } final Syntax asd = new Syntax(m.group(1).trim()); asd.setDescription(m.group(2) != null ? m.group(2).trim() : null); if (m.group(3) != null) { asd.setExtensions(Extensions.parse(m.group(3).trim())); } return asd; } Syntax(final String s);  Syntax(final String oid, final String description, final Extensions extensions); String getOID(); static Syntax parse(final String definition); @Override String format(); @Override boolean equals(final Object o); @Override int hashCode(); @Override String toString();  }
@Test(groups = "schema", dataProvider = "definitions") public void parse(final Syntax attributeSyntax, final String definition) throws Exception { final Syntax parsed = Syntax.parse(definition); Assert.assertEquals(attributeSyntax, parsed); Assert.assertEquals(definition, parsed.format()); Assert.assertEquals(attributeSyntax.format(), parsed.format()); }