final Package pkg = builder.getPackage();
RuleBase ruleBase = getRuleBase();
ruleBase.addPackage( pkg );
ruleBase = SerializationHelper.serializeObject(ruleBase);
final WorkingMemory workingMemory = ruleBase.newStatefulSession();
// workingMemory.addEventListener(new DebugAgendaEventListener());
// workingMemory.addEventListener(new
// DebugWorkingMemoryEventListener());
final List list = new ArrayList();
final Person person = new Person( "person" );
final Cheese cheese = new Cheese( "cheese",
0 );
workingMemory.setGlobal( "cheese",
cheese );
workingMemory.setGlobal( "person",
person );
workingMemory.setGlobal( "list",
list );
workingMemory.fireAllRules();
// not sure about desired state of working memory.
assertEquals( "Rules have not fired (looped) expected number of times",
10,
list.size() );