private Region createRegion(String name, Compressor compressor, boolean offHeap) {
    return getCache().<String, String>createRegionFactory().addCacheListener(CACHE_LISTENER)
        .setCacheWriter(CACHE_WRITER).setDataPolicy(DataPolicy.REPLICATE).setCloningEnabled(true)
        .setCompressor(compressor).setOffHeap(offHeap).create(name);
  }
Creates a region and assigns a compressor.

@param name a region name.
@param compressor a compressor.
geode-core/src/distributedTest/java/org/apache/geode/internal/compression/CompressionCacheListenerDUnitTest.java