@Override
  public void removeCqListener(CqListener cql) {
    if (cql == null) {
      throw new IllegalArgumentException(
          "removeCqListener parameter was null");
    }
    synchronized (clSync) {
      ArrayList<CqListener> oldListeners = cqListeners;
      if (oldListeners != null) {
        if (oldListeners.remove(cql)) {
          if (oldListeners.isEmpty()) {
            setCqListeners(null);
          }
          try {
            cql.close();
            // Handle client side exceptions.
          } catch (Exception ex) {
            logger.warn("Exception closing CQ Listener Error: {}",
                ex.getLocalizedMessage());
            if (logger.isDebugEnabled()) {
              logger.debug(ex.getMessage(), ex);
            }
          } catch (VirtualMachineError err) {
            SystemFailure.initiateFailure(err);
            // If this ever returns, rethrow the error. We're poisoned
            // now, so don't let this thread continue.
            throw err;
          } catch (Throwable t) {
            // Whenever you catch Error or Throwable, you must also
            // catch VirtualMachineError (see above). However, there is
            // _still_ a possibility that you are dealing with a cascading
            // error condition, so you also need to check to see if the JVM
            // is still usable:
            SystemFailure.checkFailure();
            logger.warn("Runtime Exception occurred closing CQ Listener Error: {}",
                t.getLocalizedMessage());
            if (logger.isDebugEnabled()) {
              logger.debug(t.getMessage(), t);
            }
          }
        }
      }
    }
  }
Removes a Cqlistener from the list of Cqlisteners on this CqQuery. Does nothing if the
specified listener has not been added. If the specified listener has been added then
{@link CacheCallback#close()} will be called on it; otherwise does nothing.

@param cql the Cqlistener to remove from the CqQuery.
@throws IllegalArgumentException if <code>cl</code> is null
geode-core/src/main/java/org/apache/geode/cache/query/internal/cq/CqAttributesImpl.java