// first share
AlphaNode alphaNode1_1 = ( AlphaNode ) alphaNode1.getSinkPropagator().getSinks()[0];
assertEquals( calculatePositiveMask(list("s"), sp), alphaNode1_1.getDeclaredMask( ) );
assertEquals( calculatePositiveMask(list("a", "s", "b"), sp), alphaNode1_1.getInferredMask() );
BetaNode betaNode1 = ( BetaNode ) alphaNode1_1.getSinkPropagator().getSinks()[0];
assertEquals( calculatePositiveMask(list("b"), sp), betaNode1.getRightDeclaredMask() );
assertEquals( calculatePositiveMask(list("a", "s", "b"), sp), betaNode1.getRightInferredMask() );
assertEquals( calculatePositiveMask(list("c"), sp), betaNode1.getLeftDeclaredMask() );
assertEquals( calculatePositiveMask(list("c"), sp), betaNode1.getLeftInferredMask() );
assertEquals( calculateNegativeMask(list("!a"), sp), betaNode1.getLeftNegativeMask() );
// second share
AlphaNode alphaNode1_2 = ( AlphaNode ) alphaNode1.getSinkPropagator().getSinks()[1];
assertEquals( calculatePositiveMask(list("i"), sp), alphaNode1_2.getDeclaredMask( ) );
assertEquals( calculatePositiveMask(list("a", "i", "b"), sp), alphaNode1_2.getInferredMask() );
BetaNode betaNode2 = ( BetaNode ) alphaNode1_2.getSinkPropagator().getSinks()[0];
assertEquals( calculatePositiveMask(list("b"), sp), betaNode2.getRightDeclaredMask() );
assertEquals( calculatePositiveMask(list("a", "i", "b"), sp), betaNode2.getRightInferredMask() );
assertEquals( calculatePositiveMask(list("j"), sp), betaNode2.getLeftDeclaredMask() );
assertEquals( calculatePositiveMask(list("a", "j"), sp), betaNode2.getLeftInferredMask() );
assertEquals( calculateNegativeMask(list("!i"), sp), betaNode2.getLeftNegativeMask() );
// test rule removal
kbase.removeRule( "org.drools", "r0" );
assertEquals( calculatePositiveMask(list("a"), sp), alphaNode1.getDeclaredMask( ) );
assertEquals( calculatePositiveMask(list("a", "i", "b"), sp), alphaNode1.getInferredMask() );
assertEquals( calculatePositiveMask(list("i"), sp), alphaNode1_2.getDeclaredMask( ) );
assertEquals( calculatePositiveMask(list("a", "i", "b"), sp), alphaNode1_2.getInferredMask() );
assertEquals( calculatePositiveMask(list("b"), sp), betaNode2.getRightDeclaredMask() );
assertEquals( calculatePositiveMask(list("a", "i", "b"), sp), betaNode2.getRightInferredMask() );
assertEquals( calculatePositiveMask(list("c"), sp), betaNode1.getLeftDeclaredMask() );
assertEquals( calculatePositiveMask(list("c"), sp), betaNode1.getLeftInferredMask() );
assertEquals( calculateNegativeMask(list("!a"), sp), betaNode1.getLeftNegativeMask() );
// have to rebuild to remove r1
kbase = getKnowledgeBase(rule1, rule2);
kbase.removeRule( "org.drools", "r1" );
otn = getObjectTypeNode(kbase, "A" );
alphaNode1 = ( AlphaNode ) otn.getSinkPropagator().getSinks()[0];
assertEquals( calculatePositiveMask(list("a"), sp), alphaNode1.getDeclaredMask( ) );
assertEquals( calculatePositiveMask(list("a", "s", "b"), sp), alphaNode1.getInferredMask() );
alphaNode1_1 = ( AlphaNode ) alphaNode1.getSinkPropagator().getSinks()[0];
assertEquals( calculatePositiveMask(list("s"), sp), alphaNode1_1.getDeclaredMask( ) );
assertEquals( calculatePositiveMask(list("a", "s", "b"), sp), alphaNode1_1.getInferredMask() );
betaNode1 = ( BetaNode ) alphaNode1_1.getSinkPropagator().getSinks()[0];
assertEquals( calculatePositiveMask(list("b"), sp), betaNode1.getRightDeclaredMask() );
assertEquals( calculatePositiveMask(list("a", "s", "b"), sp), betaNode1.getRightInferredMask() );
assertEquals( calculatePositiveMask(list("j"), sp), betaNode2.getLeftDeclaredMask() );
assertEquals( calculatePositiveMask(list("a", "j"), sp), betaNode2.getLeftInferredMask() );
assertEquals( calculateNegativeMask(list("!i"), sp), betaNode2.getLeftNegativeMask() );
}