OrDescr orConstr = (OrDescr) pattern.getDescrs().get( 0 );
assertEquals( 3,
orConstr.getDescrs().size() );
AndDescr andConstr1 = (AndDescr) orConstr.getDescrs().get( 0 );
FieldConstraintDescr fcd = (FieldConstraintDescr) andConstr1.getDescrs().get( 0 );
assertEquals( "age",
fcd.getFieldName() );
RestrictionConnectiveDescr or = (RestrictionConnectiveDescr) fcd.getRestriction().getRestrictions().get( 0 );
RestrictionConnectiveDescr and1 = (RestrictionConnectiveDescr) or.getRestrictions().get( 0 );
RestrictionConnectiveDescr and2 = (RestrictionConnectiveDescr) or.getRestrictions().get( 1 );
assertEquals( ">",
((LiteralRestrictionDescr) and1.getRestrictions().get( 0 )).getEvaluator() );
assertEquals( "60",
((LiteralRestrictionDescr) and1.getRestrictions().get( 0 )).getText() );
assertEquals( "<",
((LiteralRestrictionDescr) and1.getRestrictions().get( 1 )).getEvaluator() );
assertEquals( "70",
((LiteralRestrictionDescr) and1.getRestrictions().get( 1 )).getText() );
assertEquals( ">",
((LiteralRestrictionDescr) and2.getRestrictions().get( 0 )).getEvaluator() );
assertEquals( "50",
((LiteralRestrictionDescr) and2.getRestrictions().get( 0 )).getText() );
assertEquals( "<",
((LiteralRestrictionDescr) and2.getRestrictions().get( 1 )).getEvaluator() );
assertEquals( "55",
((LiteralRestrictionDescr) and2.getRestrictions().get( 1 )).getText() );
fcd = (FieldConstraintDescr) andConstr1.getDescrs().get( 1 );
assertEquals( "hair",
fcd.getFieldName() );
assertEquals( "==",
((LiteralRestrictionDescr) fcd.getRestrictions().get( 0 )).getEvaluator() );
assertEquals( "black",
((LiteralRestrictionDescr) fcd.getRestrictions().get( 0 )).getText() );
AndDescr andConstr2 = (AndDescr) orConstr.getDescrs().get( 1 );
assertEquals( 2,
andConstr2.getDescrs().size() );
fcd = (FieldConstraintDescr) andConstr2.getDescrs().get( 0 );
assertEquals( "age",
fcd.getFieldName() );
assertEquals( "==",
((LiteralRestrictionDescr) fcd.getRestrictions().get( 0 )).getEvaluator() );
assertEquals( "40",
((LiteralRestrictionDescr) fcd.getRestrictions().get( 0 )).getText() );
fcd = (FieldConstraintDescr) andConstr2.getDescrs().get( 1 );
assertEquals( "hair",
fcd.getFieldName() );
assertEquals( "==",
((LiteralRestrictionDescr) fcd.getRestrictions().get( 0 )).getEvaluator() );
assertEquals( "pink",
((LiteralRestrictionDescr) fcd.getRestrictions().get( 0 )).getText() );
AndDescr andConstr3 = (AndDescr) orConstr.getDescrs().get( 2 );
assertEquals( 2,
andConstr3.getDescrs().size() );
fcd = (FieldConstraintDescr) andConstr3.getDescrs().get( 0 );
assertEquals( "age",
fcd.getFieldName() );
assertEquals( "==",
((LiteralRestrictionDescr) fcd.getRestrictions().get( 0 )).getEvaluator() );
assertEquals( "12",
((LiteralRestrictionDescr) fcd.getRestrictions().get( 0 )).getText() );
OrDescr orConstr2 = (OrDescr) andConstr3.getDescrs().get( 1 );
fcd = (FieldConstraintDescr) orConstr2.getDescrs().get( 0 );
assertEquals( "hair",
fcd.getFieldName() );