@Test public void testPackNestedOr() { final GroupElement or1 = GroupElementFactory.newOrInstance(); final Pattern pattern1 = new Pattern( 0, null ); or1.addChild( pattern1 ); final Pattern pattern2 = new Pattern( 0, null ); or1.addChild( pattern2 ); assertEquals( 2, or1.getChildren().size() ); assertSame( pattern1, or1.getChildren().get( 0 ) ); assertSame( pattern2, or1.getChildren().get( 1 ) ); final GroupElement or2 = GroupElementFactory.newOrInstance(); or2.addChild( or1 ); or2.pack(); assertEquals( 2, or2.getChildren().size() ); assertSame( pattern1, or2.getChildren().get( 0 ) ); assertSame( pattern2, or2.getChildren().get( 1 ) ); }
@Test public void testAddSingleBranchAnd() { final GroupElement and1 = GroupElementFactory.newAndInstance(); final Pattern pattern = new Pattern( 0, null ); and1.addChild( pattern ); assertEquals( 1, and1.getChildren().size() ); assertSame( pattern, and1.getChildren().get( 0 ) ); final GroupElement or1 = GroupElementFactory.newOrInstance(); or1.addChild( and1 ); or1.pack(); assertEquals( 1, or1.getChildren().size() ); assertSame( pattern, or1.getChildren().get( 0 ) ); }
@Test public void testAddSingleBranchOr() { final GroupElement or1 = GroupElementFactory.newOrInstance(); final Pattern pattern = new Pattern( 0, null ); or1.addChild( pattern ); assertEquals( 1, or1.getChildren().size() ); assertSame( pattern, or1.getChildren().get( 0 ) ); final GroupElement and1 = GroupElementFactory.newAndInstance(); and1.addChild( or1 ); and1.pack(); assertEquals( 1, and1.getChildren().size() ); assertSame( pattern, and1.getChildren().get( 0 ) ); }
final GroupElement or1 = GroupElementFactory.newOrInstance(); final Pattern pattern1 = new Pattern( 0, null ); or1.getChildren().get( 1 ) ); final GroupElement or2 = GroupElementFactory.newOrInstance(); or2.addChild( and1 ); or2.getChildren().get( 0 ) ); final GroupElement or3 = GroupElementFactory.newOrInstance(); or3.addChild( or2 );
"c" ); final GroupElement or = GroupElementFactory.newOrInstance(); or.addChild( a ); or.addChild( b );
final GroupElement or1 = GroupElementFactory.newOrInstance(); final Pattern pattern1 = new Pattern( 0, null ); or1.getChildren().get( 1 ) ); final GroupElement or2 = GroupElementFactory.newOrInstance(); or2.addChild( and1 ); or2.getChildren().get( 0 ) ); final GroupElement or3 = GroupElementFactory.newOrInstance(); or3.addChild( or2 );
final GroupElement or = GroupElementFactory.newOrInstance(); parent.addChild( or );
final GroupElement or = GroupElementFactory.newOrInstance(); parent.addChild( or );
final GroupElement or = GroupElementFactory.newOrInstance(); or.addChild( a ); or.addChild( b ); parent.addChild( c ); final GroupElement or2 = GroupElementFactory.newOrInstance();
final GroupElement or1 = GroupElementFactory.newOrInstance(); or1.addChild( b ); or1.addChild( c ); and.addChild( and1 ); final GroupElement or2 = GroupElementFactory.newOrInstance(); or2.addChild( d ); or2.addChild( e ); final GroupElement not1 = GroupElementFactory.newNotInstance(); not1.addChild( f ); final GroupElement or3 = GroupElementFactory.newOrInstance(); or3.addChild( g );
final GroupElement or = GroupElementFactory.newOrInstance(); and1.addChild( or );
and.addChild( b ); final GroupElement or = GroupElementFactory.newOrInstance(); or.addChild( c ); or.addChild( d ); final GroupElement or2 = GroupElementFactory.newOrInstance(); not.addChild( or2 ); or2.addChild( g );
final GroupElement or1 = GroupElementFactory.newOrInstance(); and3.addChild( or1 ); final GroupElement exist1 = GroupElementFactory.newExistsInstance();