KnowledgeBase kbase = KnowledgeBaseFactory.newKnowledgeBase( kconf );
kbase.addKnowledgePackages( kbuilder.getKnowledgePackages() );
kbase = org.drools.compiler.integrationtests.SerializationHelper.serializeObject(kbase);
final StatelessKnowledgeSession ksession = kbase.newStatelessKnowledgeSession();
final List list = new ArrayList();
ksession.setGlobal( "list",
list );
final Person p1 = new Person( "p1",
"stilton" );
final Person p2 = new Person( "p2",
"cheddar" );
final Person p3 = new Person( "p3",
"stilton" );
final Cheese stilton = new Cheese( "stilton",
15 );
final Cheese cheddar = new Cheese( "cheddar",
15 );
ksession.execute( Arrays.asList( new Object[]{p1, stilton, p2, cheddar, p3} ) );
assertEquals( 3,
list.size() );
}