@Test
public void testGetMaxRepeat() throws Exception {

    final SrgsXmlDocument document = new SrgsXmlDocument();
    final Grammar grammar = document.getGrammar();
    grammar.setRoot("test");
    final Rule rule = grammar.appendChild(Rule.class);
    rule.setId("test");
    final OneOf politeOneOf = rule.appendChild(OneOf.class);
    final Item item = politeOneOf.appendChild(Item.class);
    Assert.assertEquals(1, item.getMaxRepeat());
    item.setOptional();
    Assert.assertEquals(1, item.getMaxRepeat());
    final int repeat = 6;
    item.setRepeat(repeat);
    Assert.assertEquals(repeat, item.getMaxRepeat());
    final int min = 4;
    final int max = 7;
    item.setRepeat(min, max);
    Assert.assertEquals(max, item.getMaxRepeat());
    final int min2 = 4;
    final int max2 = -1;
    item.setRepeat(min2, max2);
    Assert.assertEquals(max2, item.getMaxRepeat());
}