}
ReteooWorkingMemoryInterface wm = ((StatefulKnowledgeSessionImpl)kbase.newStatefulKnowledgeSession()).session;
LeftInputAdapterNode liaNode = (LeftInputAdapterNode) node.getSinkPropagator().getSinks()[0];
JoinNode j2 = ( JoinNode ) liaNode.getSinkPropagator().getSinks()[0]; // $p2
JoinNode j3 = ( JoinNode ) j2.getSinkPropagator().getSinks()[0]; // $p3
JoinNode j4 = ( JoinNode ) j3.getSinkPropagator().getSinks()[0]; // $p4
JoinNode j5 = ( JoinNode ) j4.getSinkPropagator().getSinks()[0]; // $p5
//JoinNode j6 = ( JoinNode ) j5.getSinkPropagator().getSinks()[0]; // $p6 // won't compile
JoinNode j7 = ( JoinNode ) j5.getSinkPropagator().getSinks()[0]; // $p7
JoinNode j8 = ( JoinNode ) j7.getSinkPropagator().getSinks()[0]; // $p8
JoinNode j9 = ( JoinNode ) j8.getSinkPropagator().getSinks()[0]; // $p9
JoinNode j10 = ( JoinNode ) j9.getSinkPropagator().getSinks()[0]; // $p10
JoinNode j11 = ( JoinNode ) j10.getSinkPropagator().getSinks()[0]; // $p11
SingleBetaConstraints c = ( SingleBetaConstraints ) j2.getRawConstraints();
assertEquals( "$name", ((VariableConstraint)c.getConstraint()).getRequiredDeclarations()[0].getIdentifier() );
assertTrue( c.isIndexed() );
BetaMemory bm = ( BetaMemory ) wm.getNodeMemory( j2 );
assertTrue( bm.getLeftTupleMemory() instanceof LeftTupleIndexHashTable );
assertTrue( bm.getRightTupleMemory() instanceof RightTupleIndexHashTable );
c = ( SingleBetaConstraints ) j3.getRawConstraints();
assertEquals( "name", ((VariableConstraint)c.getConstraint()).getRequiredDeclarations()[0].getIdentifier() );
assertTrue( c.isIndexed() );
bm = ( BetaMemory ) wm.getNodeMemory( j3 );
assertTrue( bm.getLeftTupleMemory() instanceof LeftTupleIndexHashTable );
assertTrue( bm.getRightTupleMemory() instanceof RightTupleIndexHashTable );
c = ( SingleBetaConstraints ) j4.getRawConstraints();
assertEquals( "$p1", ((VariableConstraint)c.getConstraint()).getRequiredDeclarations()[0].getIdentifier() );
assertFalse( c.isIndexed() );
bm = ( BetaMemory ) wm.getNodeMemory( j4 );
assertTrue( bm.getLeftTupleMemory() instanceof LeftTupleList );
assertTrue( bm.getRightTupleMemory() instanceof RightTupleList );
c = ( SingleBetaConstraints ) j5.getRawConstraints();
assertEquals( "name", ((VariableConstraint)c.getConstraint()).getRequiredDeclarations()[0].getIdentifier() );
assertTrue( c.isIndexed() );
bm = ( BetaMemory ) wm.getNodeMemory( j5 );
assertTrue( bm.getLeftTupleMemory() instanceof LeftTupleIndexHashTable );
assertTrue( bm.getRightTupleMemory() instanceof RightTupleIndexHashTable );
// won't compile
// c = ( SingleBetaConstraints ) j6.getRawConstraints();
// assertEquals( "name", ((VariableConstraint)c.getConstraint()).getRequiredDeclarations()[0].getIdentifier() );
// assertFalse( c.isIndexed() );
// bm = ( BetaMemory ) wm.getNodeMemory( j6 );
// assertTrue( bm.getLeftTupleMemory() instanceof LeftTupleList );
// assertTrue( bm.getRightTupleMemory() instanceof RightTupleList );
c = ( SingleBetaConstraints ) j7.getRawConstraints();
assertEquals( "name", ((VariableConstraint)c.getConstraint()).getRequiredDeclarations()[0].getIdentifier() );
assertTrue( c.isIndexed() );
bm = ( BetaMemory ) wm.getNodeMemory( j7 );
assertTrue( bm.getLeftTupleMemory() instanceof LeftTupleIndexHashTable );
assertTrue( bm.getRightTupleMemory() instanceof RightTupleIndexHashTable );
c = ( SingleBetaConstraints ) j8.getRawConstraints();
assertEquals( "name", ((VariableConstraint)c.getConstraint()).getRequiredDeclarations()[0].getIdentifier() );
assertTrue( c.isIndexed() );
bm = ( BetaMemory ) wm.getNodeMemory( j8 );
assertTrue( bm.getLeftTupleMemory() instanceof LeftTupleIndexHashTable );
assertTrue( bm.getRightTupleMemory() instanceof RightTupleIndexHashTable );
c = ( SingleBetaConstraints ) j9.getRawConstraints();
assertEquals( "$p1", ((VariableConstraint)c.getConstraint()).getRequiredDeclarations()[0].getIdentifier() );
assertFalse( c.isIndexed() );
bm = ( BetaMemory ) wm.getNodeMemory( j9 );
assertTrue( bm.getLeftTupleMemory() instanceof LeftTupleList );
assertTrue( bm.getRightTupleMemory() instanceof RightTupleList );
c = ( SingleBetaConstraints ) j10.getRawConstraints();
assertEquals( "name", ((VariableConstraint)c.getConstraint()).getRequiredDeclarations()[0].getIdentifier() );
assertTrue( c.isIndexed() );
bm = ( BetaMemory ) wm.getNodeMemory( j10 );
assertTrue( bm.getLeftTupleMemory() instanceof LeftTupleIndexHashTable );
assertTrue( bm.getRightTupleMemory() instanceof RightTupleIndexHashTable );
c = ( SingleBetaConstraints ) j11.getRawConstraints();
assertEquals( "$p1", ((PredicateConstraint)c.getConstraint()).getRequiredDeclarations()[0].getIdentifier() );
assertFalse( c.isIndexed() );
bm = ( BetaMemory ) wm.getNodeMemory( j11 );
assertTrue( bm.getLeftTupleMemory() instanceof LeftTupleList );
assertTrue( bm.getRightTupleMemory() instanceof RightTupleList );