@Test
public void updateTest() {
StatefulKnowledgeSession ksession = createSession();
ksession.setGlobal("myGlobalObj", new MyObject("myglobalObj"));
FactHandle handle = ksession.insert(new MyObject("obj1"));
Assert.assertNotNull(handle);
Assert.assertEquals(true, ((DefaultFactHandle) handle).isDisconnected());
int fired = ksession.fireAllRules();
Assert.assertEquals(fired, 1);
Assert.assertEquals(1, ksession.getFactCount());
ksession.update(handle, new MyObject("obj2"));
Assert.assertEquals(1, ksession.getFactCount());
fired = ksession.fireAllRules();
Assert.assertEquals(fired, 1);