private void handleInferenceStatusChangedResult(CycList data) {
    // Expected format: (:INFERENCE-STATUS <STATUS-KEYWORD> <SUSPEND-REASON>)
    if (data.size() != 3) {
      throw new RuntimeException("Got wrong number of arguments " + "from inference status changed (expected 3): " + data);
    }
    Object statusObj = data.get(1);
    if ((statusObj == null) || (!(statusObj instanceof CycSymbol))) {
      throw new RuntimeException("Got bad inference status: " + statusObj);
    }
    InferenceStatus newStatus = InferenceStatus.findInferenceStatus((CycSymbol) statusObj);
    InferenceStatus oldStatus = status;
    status = newStatus;
    if (status == null) {
      throw new RuntimeException("Got bad inference status name: " + statusObj);
    }
    final Object cycSuspendReason = data.get(2);
    if (cycSuspendReason instanceof CycSymbol || cycSuspendReason == null) {
      suspendReason = InferenceWorkerSuspendReason.fromCycSymbol((CycSymbol) cycSuspendReason);
    } else if (cycSuspendReason instanceof CycList
            && InferenceWorkerSuspendReason.ERROR_SYMBOL.equals(((CycList) cycSuspendReason).get(0))) {
      suspendReason = InferenceWorkerSuspendReason.createFromErrorString((String) ((CycList) cycSuspendReason).get(1));
    } else {
      throw new RuntimeException("Unable to create InferenceWorkerSuspendReason from ("
              + cycSuspendReason.getClass().getName() + ") " + cycSuspendReason.toString());
    }
    fireInferenceStatusChanged(oldStatus);
  }