### Question:
CompositeRule extends Rule { abstract Rule getRule(int i);    }### Answer:
@Test public void testLeftAssociativeComposition() throws RuleException { final CompositeRule rule = new LeftAssociativeComposition(L, R); final Item targetColumn = rule.apply(sourceColumn); assertSame(L, rule.getRule(0)); assertSame(R, rule.getRule(1)); assertEquals("R", targetColumn.getName()); assertEquals("R", targetColumn.getLongName()); assertEquals("L", targetColumn.getRole()); }
@Test public void testRightAssociativeComposition() throws RuleException { final CompositeRule rule = new RightAssociativeComposition(L, R); final Item targetColumn = rule.apply(sourceColumn); assertSame(L, rule.getRule(0)); assertSame(R, rule.getRule(1)); assertEquals("L", targetColumn.getName()); assertEquals("R", targetColumn.getLongName()); assertEquals("L", targetColumn.getRole()); }