m.lhs.length );
assertEquals( 0,
m.rhs.length );
assertTrue( m.lhs[ 0 ] instanceof FactPattern );
final FactPattern fp = (FactPattern) m.lhs[ 0 ];
assertEquals( "Customer",
fp.getFactType() );
assertEquals( "c",
fp.getBoundName() );
assertEquals( 0,
fp.getNumberOfConstraints() );
assertTrue( m.lhs[ 1 ] instanceof FromCollectCompositeFactPattern );
final FromCollectCompositeFactPattern fcfp = (FromCollectCompositeFactPattern) m.lhs[ 1 ];
assertNotNull( fcfp.getFactPattern() );
assertEquals( "java.util.List",
fcfp.getFactPattern().getFactType() );
assertEquals( "items",
fcfp.getFactPattern().getBoundName() );
assertEquals( 1,
fcfp.getFactPattern().getNumberOfConstraints() );
assertTrue( fcfp.getFactPattern().getConstraint( 0 ) instanceof SingleFieldConstraint );
final SingleFieldConstraint sfc0 = (SingleFieldConstraint) fcfp.getFactPattern().getConstraint( 0 );
assertNull( sfc0.getFactType() );
assertNull( sfc0.getFieldName() );
assertEquals( "size == c.items.size",
sfc0.getValue() );
assertEquals( BaseSingleFieldConstraint.TYPE_PREDICATE,
sfc0.getConstraintValueType() );
assertNotNull( fcfp.getRightPattern() );
assertTrue( fcfp.getRightPattern() instanceof FactPattern );
final FactPattern rfp = (FactPattern) fcfp.getRightPattern();
assertEquals( "Item",
rfp.getFactType() );
assertEquals( "var",
rfp.getBoundName() );
assertEquals( 1,
rfp.getNumberOfConstraints() );
assertTrue( rfp.getConstraint( 0 ) instanceof SingleFieldConstraint );
final SingleFieldConstraint sfc1 = (SingleFieldConstraint) rfp.getConstraint( 0 );
assertEquals( "Item",
sfc1.getFactType() );
assertEquals( "price",
sfc1.getFieldName() );
assertEquals( "10",