private void createCacheForVM1() throws IOException, ClassNotFoundException {
    DiskStoreFactory dsf = getCache().createDiskStoreFactory();
    dsf.setDiskDirs(foldersForServer2);

    DiskStore diskStore = dsf.create(uniqueName);

    InternalRegionFactory factory =
        getCache().createInternalRegionFactory(RegionShortcut.REPLICATE_PERSISTENT);
    factory.setDiskSynchronous(false);
    factory.setDiskStoreName(diskStore.getName());

    DistributedRegion distRegion =
        new DistributedRegion(regionName, factory.getCreateAttributes(), null,
            getCache(),
            new InternalRegionArguments().setDestroyLockFlag(true).setRecreateFlag(false)
                .setSnapshotInputStream(null).setImageTarget(null),
            disabledClock());

    distRegion.entries.setEntryFactory(new TestableDiskRegionEntryFactory());
    factory.setInternalMetaRegion(distRegion).setDestroyLockFlag(true)
        .setSnapshotInputStream(null).setImageTarget(null);
    factory.create(regionName);
  }
This method is used to create Cache in VM1
geode-core/src/distributedTest/java/org/apache/geode/internal/cache/ClearDuringGiiOplogWithMissingCreateRegressionTest.java