@Override
  public void addCqListener(CqListener cql) {
    if (cql == null) {
      throw new IllegalArgumentException(
          "addCqListener parameter was null");
    }
    synchronized (clSync) {
      ArrayList<CqListener> oldListeners = cqListeners;
      if (oldListeners == null || oldListeners.size() == 0) {
        ArrayList<CqListener> al = new ArrayList<>(1);
        al.add(cql);
        setCqListeners(al);
      } else {
        if (!oldListeners.contains(cql)) {
          oldListeners.add(cql);
        }
      }
    }
  }
Adds a Cqlistener to the end of the list of Cqlisteners on this CqQuery.

@param cql the user defined cq listener to add to the CqQuery.
@throws IllegalArgumentException if <code>aListener</code> is null
geode-core/src/main/java/org/apache/geode/cache/query/internal/cq/CqAttributesImpl.java