assertTrue( list.contains( "-neg" ) );
assertEquals( 1, kSession.getEntryPoint( "DEFAULT" ).getObjects().size() ); //just go1
assertEquals( 1, kSession.getEntryPoint( "neg" ).getObjects().size() ); // neg
NamedEntryPoint ep = ( NamedEntryPoint ) ((StatefulKnowledgeSessionImpl)kSession).getEntryPoint( "DEFAULT" );
ObjectHashMap equalityMap = ep.getTruthMaintenanceSystem().getEqualityKeyMap();
assertEquals( 2, equalityMap.size() ); // go1, neg are two different strings.
org.drools.core.util.Iterator it = equalityMap.iterator();
EqualityKey key = ( EqualityKey ) (( ObjectEntry ) it.next() ).getValue();
while ( !key.getFactHandle().getObject().equals( "neg") ) {
key = ( EqualityKey ) (( ObjectEntry ) it.next() ).getValue();
}
assertEquals( 3, key.getBeliefSet().size() );
kSession.retract( key.getBeliefSet().getFactHandle() );
assertEquals( 0, key.getBeliefSet().size() );
assertEquals( 1, kSession.getEntryPoint( "DEFAULT" ).getObjects().size() ); //just go1
assertEquals( 0, kSession.getEntryPoint( "neg" ).getObjects().size() ); // neg
assertEquals( 0, key.getBeliefSet().size() );
assertEquals( 1, ep.getTruthMaintenanceSystem().getEqualityKeyMap().size() );
}