private void connect() throws CacheException {
    Properties cfg = new Properties();
    cfg.setProperty(MCAST_PORT, "0");
    cfg.setProperty(LOCATORS, "");
    cfg.setProperty(STATISTIC_SAMPLING_ENABLED, "false");

    ds = DistributedSystem.connect(cfg);
    c = CacheFactory.create(ds);
    AttributesFactory factory = new AttributesFactory();
    factory.setScope(Scope.LOCAL);
    factory.setDataPolicy(DataPolicy.PERSISTENT_REPLICATE);
    factory.setDiskSynchronous(true);
    factory.setDiskStoreName(
        c.createDiskStoreFactory().create("DiskInstantiatorsJUnitTest").getName());

    r = c.createRegion("DiskInstantiatorsJUnitTest", factory.create());
  }
This class makes sure that instantatiors are persisted to disk and can be recovered.
geode-core/src/integrationTest/java/org/apache/geode/DiskInstantiatorsJUnitTest.java