ReteooWorkingMemoryInterface wm = ((StatefulKnowledgeSessionImpl)kbase.newStatefulKnowledgeSession());
ObjectTypeNode otnB = getObjectTypeNode(kbase, "B" );
List<String> sp = getSettableProperties(wm, otnB);
AlphaNode alphaNode = ( AlphaNode ) otnB.getSinkPropagator().getSinks()[0];
assertEquals( calculatePositiveMask(list("a"), sp), alphaNode.getDeclaredMask( ) );
assertEquals( calculatePositiveMask(list("a", "b", "c"), sp), alphaNode.getInferredMask());
ObjectTypeNode otnA = getObjectTypeNode(kbase, "A" );
BetaNode betaNodeA1 = ( BetaNode ) otnA.getSinkPropagator().getSinks()[0];
BetaNode betaNodeA2 = ( BetaNode ) otnA.getSinkPropagator().getSinks()[1];
assertEquals( calculatePositiveMask(list("i"), sp), betaNodeA1.getRightDeclaredMask() );
assertEquals( calculatePositiveMask(list("i"), sp), betaNodeA1.getRightInferredMask() );
assertEquals( calculatePositiveMask(list("b"), sp), betaNodeA1.getLeftDeclaredMask() );
assertEquals( calculatePositiveMask(list("a", "b"), sp), betaNodeA1.getLeftInferredMask() );
assertEquals( calculatePositiveMask(list("j"), sp), betaNodeA2.getRightDeclaredMask() );
assertEquals( calculatePositiveMask(list("j"), sp), betaNodeA2.getRightInferredMask() );
assertEquals( calculatePositiveMask(list("c"), sp), betaNodeA2.getLeftDeclaredMask() );
assertEquals( calculatePositiveMask(list("a", "c"), sp), betaNodeA2.getLeftInferredMask() );
ObjectTypeNode otnC = getObjectTypeNode(kbase, "C" );
BetaNode betaNodeC = ( BetaNode ) otnC.getSinkPropagator().getSinks()[0];
assertEquals( EmptyBitMask.get(), betaNodeC.getRightDeclaredMask() );
assertEquals( EmptyBitMask.get(), betaNodeC.getRightInferredMask() );
assertEquals( AllSetBitMask.get(), betaNodeC.getLeftDeclaredMask() );
assertEquals( AllSetBitMask.get(), betaNodeC.getLeftInferredMask() );
ObjectTypeNode otnD = getObjectTypeNode(kbase, "D" );
BetaNode betaNodeD = ( BetaNode ) otnC.getSinkPropagator().getSinks()[0];
assertEquals( EmptyBitMask.get(), betaNodeD.getRightDeclaredMask() );
assertEquals( EmptyBitMask.get(), betaNodeD.getRightInferredMask() );
assertEquals( AllSetBitMask.get(), betaNodeD.getLeftDeclaredMask() );
assertEquals( AllSetBitMask.get(), betaNodeD.getLeftInferredMask() );
kbase.removeRule( "org.drools.compiler.integrationtests", "r1" );
assertEquals( calculatePositiveMask(list("a"), sp), alphaNode.getDeclaredMask( ) );
assertEquals( calculatePositiveMask(list("a", "b"), sp), alphaNode.getInferredMask());
}