public void removeAllInferenceListeners() {
    synchronized (inferenceListeners) {
      Object[] listenerArray = inferenceListeners.getListenerList();
      for (int i = 0, size = listenerArray.length; i < size; i += 2) {
        inferenceListeners.remove((Class) listenerArray[i],
                (EventListener) listenerArray[i + 1]);
      }
    }
  }