workingMemory.fireAllRules();
assertEquals( ++fired,
list.size() );
// only stilton, so should not fire again
FactHandle stilton1 = (FactHandle) workingMemory.insert( new Cheese( "stilton",
10 ) );
workingMemory.fireAllRules();
assertEquals( fired,
list.size() );
// only stilton, so should not fire again
FactHandle stilton2 = (FactHandle) workingMemory.insert( new Cheese( "stilton",
11 ) );
workingMemory.fireAllRules();
assertEquals( fired,
list.size() );
// still only stilton, so should not fire
workingMemory.retract( stilton1 );
workingMemory.fireAllRules();
assertEquals( fired,
list.size() );
// there is a brie, so should not fire
FactHandle brie = (FactHandle) workingMemory.insert( new Cheese( "brie",
10 ) );
workingMemory.fireAllRules();
assertEquals( fired,
list.size() );