public void testSpecWithRefinement() throws Exception
{
SubtreeSpecification ss = parser.parse( SPEC_WITH_REFINEMENT );
// The items
Refinement topItem = new ItemRefinement( TOP_OC );
Refinement aliasItem = new ItemRefinement( ALIAS_OC );
Refinement personItem = new ItemRefinement( PERSON_OC );
Refinement countryItem = new ItemRefinement( COUNTRY_OC );
// The inner OR refinement or:{item:2.5.6.1, item:person}
List<Refinement> orList = new ArrayList<Refinement>();
orList.add( aliasItem );
orList.add( personItem );
Refinement orRefinement = new OrRefinement( orList );
// The inner AND refinement and:{ item:2.5.6.0, or:... }
List<Refinement> innerAndList = new ArrayList<Refinement>();
innerAndList.add( topItem );
innerAndList.add( orRefinement );
Refinement innerAndRefinement = new AndRefinement( innerAndList );
// The NOT refinement not:item:2.5.6.2
Refinement notRefinement = new NotRefinement( countryItem );
// The outer AND refinement and:{and:..., not:...}
List<Refinement> outerAndList = new ArrayList<Refinement>();
outerAndList.add( innerAndRefinement );
outerAndList.add( notRefinement );