@Override
      public void run() {
        Region<Object, Object> region = null;
        try {
          region = createRegion(regionName, "root", getRegionAttributes());
          // since random keys are being used, we might hit duplicates
          logger.info("<ExpectedException action=add>"
              + "org.apache.geode.cache.EntryExistsException" + "</ExpectedException>");
          Random rand = new Random(System.currentTimeMillis());
          for (int i = 0; i < 20000; i++) {
            boolean created = false;
            while (!created) {
              try {
                int val = rand.nextInt(100000000);
                String key = String.valueOf(val);
                region.create(key, val);
                created = true;
              } catch (EntryExistsException eee) {
                // loop to try again
              }
            }
          }
        } catch (GemFireException ex) {
          fail("while creating or populating partitioned region", ex);
        } finally {
          if (region != null) {
            logger.info("<ExpectedException action=remove>"
                + "org.apache.geode.cache.EntryExistsException" + "</ExpectedException>");
          }
        }
      }
Tests the compatibility of creating certain kinds of subregions of a local region.
geode-core/src/distributedTest/java/org/apache/geode/cache30/PartitionedRegionDUnitTest.java