result = (List) template.executeStateful("test", null, new StatefulRuleSessionCallback() {
public Object execute(StatefulRuleSession session) throws InvalidRuleSessionException, InvalidHandleException, RemoteException {
try {
session.removeObject(browserHandle);
throw new InvalidRuleSessionException("This must be invalid!");
}
catch (InvalidRuleSessionException ex) {
// expected
}
session.addObject("MSIE");