public static void registerInterestListCQ(String regionName, int keySize) {
    // Get CQ Service.
    Region region = null;
    try {
      region = cache.getRegion("root").getSubregion(regionName);
      region.getAttributesMutator().addCacheListener(new CertifiableTestCacheListener());
    } catch (Exception e) {
      fail("Failed to get Region.", e);
    }

    try {
      List list = new ArrayList();
      for (int i = 1; i <= keySize; i++) {
        list.add(KEY + i);
      }
      region.registerInterest(list);
    } catch (Exception ex) {
      fail("Failed to Register InterestList", ex);
    }
  }
A helper for creating a subregion, potentially using a package protected method to do so.

@param root the parent region
@param name the name of the subregion to create
@param attrs the attributes used to create the subregion
@param internalArgs if not null, then use the package protected creation mechanism
@return the subregion whose parent is the provided root
@see Region#createSubregion(String, RegionAttributes)
@see LocalRegion#createSubregion(String, RegionAttributes, InternalRegionArguments)
geode-cq/src/distributedTest/java/org/apache/geode/internal/cache/ha/CQListGIIDistributedTest.java