p.constraintList.constraints[1] );
}
public void testWithCompositeNesting() {
final FactPattern p = new FactPattern();
final SingleFieldConstraint x = new SingleFieldConstraint( "x" );
p.addConstraint( x );
assertEquals( 1,
p.constraintList.constraints.length );
assertEquals( x,
p.constraintList.constraints[0] );
final CompositeFieldConstraint y = new CompositeFieldConstraint();
y.addConstraint( new SingleFieldConstraint("y") );
y.addConstraint( new SingleFieldConstraint("z") );
p.addConstraint( y );
assertEquals( 2,
p.constraintList.constraints.length );
assertEquals( x,
p.constraintList.constraints[0] );