str += "then \n";
str += "end \n";
KnowledgeBase kbase = loadKnowledgeBaseFromString( str );
ReteooWorkingMemoryInterface wm = ((StatefulKnowledgeSessionImpl)kbase.newStatefulKnowledgeSession()).session;
ObjectTypeNode otnPerson = getObjectTypeNode(kbase, "Person" );
ObjectTypeNode otnCheese = getObjectTypeNode(kbase, "Cheese" );
ObjectTypeNode otnCat = getObjectTypeNode(kbase, "Cat" );
assertEquals( 0, otnPerson.getOtnIdCounter() );
assertEquals( 0, otnCheese.getOtnIdCounter() );
assertEquals( 0, otnCat.getOtnIdCounter() );
wm.insert( new Person() );
wm.insert( new Cat("yyy") );
wm.insert( new Cheese() );
assertEquals( 2, otnPerson.getOtnIdCounter() );
assertEquals( 4, otnCheese.getOtnIdCounter() );
assertEquals( 2, otnCat.getOtnIdCounter() );
}