private void createCacheAndColocatedPRs(String colocatedWith) {
    cache = (InternalCache) new CacheFactory()
        .set(LOCATORS, "")
        .create();

    cache.createDiskStoreFactory()
        .setDiskDirs(new File[] {temporaryFolder.getRoot()})
        .create("disk");

    PartitionAttributesFactory partitionAttributesFactory = new PartitionAttributesFactory();
    partitionAttributesFactory.setRedundantCopies(0);
    partitionAttributesFactory.setRecoveryDelay(-1);
    partitionAttributesFactory.setStartupRecoveryDelay(-1);

    RegionFactory regionFactory = cache.createRegionFactory(PARTITION_PERSISTENT);
    regionFactory.setDiskStoreName("disk");
    regionFactory.setPartitionAttributes(partitionAttributesFactory.create());

    regionFactory.create("region1");
    regionFactory.create("region2");

    partitionAttributesFactory = new PartitionAttributesFactory();
    partitionAttributesFactory.setRedundantCopies(0);
    partitionAttributesFactory.setRecoveryDelay(-1);
    partitionAttributesFactory.setStartupRecoveryDelay(-1);
    if (colocatedWith != null) {
      partitionAttributesFactory.setColocatedWith(colocatedWith);
    }

    regionFactory = cache.createRegionFactory(PARTITION_PERSISTENT);
    regionFactory.setDiskStoreName("disk");
    regionFactory.setPartitionAttributes(partitionAttributesFactory.create());

    regionFactory.create("region3");
  }
Create three PRs on a VM, named region1, region2, and region3. The colocated with attribute
describes which region region3 should be colocated with.
geode-core/src/integrationTest/java/org/apache/geode/internal/cache/partitioned/colocation/ModifyColocationIntegrationTest.java