ksession.setGlobal( "list", list );
ksession.setGlobal( "latch", latch );
ksession.fireAllRules();
Thread.sleep(500); // this makes sure it actually enters a rule
kbase.removeRule("org.drools.compiler.test", "TimerRule");
ksession.fireAllRules();
latch.countDown();
Thread.sleep(500); // allow the last rule, if we were in the middle of one to actually fire, before clearing
ksession.fireAllRules();
list.clear();