@Override
      public void run2() throws CacheException {
        DefaultQueryService qs = (DefaultQueryService) getCache().getQueryService();
        Collection<CacheClientProxy> proxies = CacheClientNotifier.getInstance().getClientProxies();
        Iterator iter = proxies.iterator();
        try {
          for (CacheClientProxy p : proxies) {
            ClientProxyMembershipID clientId = p.getProxyID();
            List cqs = qs.getCqService().getAllClientCqs(clientId);
            getCache().getLogger()
                .fine("Number of CQs found for client :" + clientId + " are :" + cqs.size());
            if (cqs.size() != numCQs) {
              fail("Number of CQs registerted by the client is :" + cqs.size()
                  + " less than expected : " + numCQs);
            }
            CqQuery cq = (CqQuery) cqs.get(0);
            LocalRegion region1 = (LocalRegion) getRootRegion().getSubregion(regions[0]);
            if (cq.getName().startsWith("client1_")) {
              if (region1.getFilterProfile().getKeysOfInterest(clientId) == null || region1
                  .getFilterProfile().getKeysOfInterest(clientId).size() != interestSize) {
                fail("Interest registartion during Secondary HARegion creation has failed.");
              }
            } else {
              if (!region1.getFilterProfile().isInterestedInAllKeys(clientId)) {
                fail("Interest registartion during Secondary HARegion creation has failed.");
              }
            }
          }
        } catch (Exception ex) {
          fail("Exception while validating filter count. ", ex);
        }
      }
Test Filter registration during GII. Bug fix 39014
geode-cq/src/distributedTest/java/org/apache/geode/cache/query/cq/dunit/CqQueryUsingPoolDUnitTest.java