@Override
    public void run() {
      Random opRandom = new Random();
      Random keyRandom = new Random();
      long opCount = 0;
      while (opCount < maxOpCount) {
        int optype = opRandom.nextInt(3);
        switch (optype) {
          case 0:
            rgn.create(testId + "_" + id + "_" + createKeyID, value);
            opCount++;
            ++createKeyID;
            ++totalEntries;
            break;
          case 1: {
            int key = keyRandom.nextInt(createKeyID);
            try {
              rgn.put(testId + "_" + id + "_" + key, value);
              opCount++;
            } catch (EntryNotFoundException ignored) {

            } catch (EntryDestroyedException ignored) {

            }
          }
            break;
          case 2: {
            int key = keyRandom.nextInt(createKeyID);
            try {
              rgn.destroy(testId + "_" + id + "_" + key);
              // don't count these as ops; they are tiny
              --totalEntries;
            } catch (EntryNotFoundException ignored) {

            } catch (EntryDestroyedException ignored) {

            }
          }
            break;
          default:
            throw new IllegalStateException();

        }
      }
    }
Disk region recovery test for Persist only with sync writes. Test has four steps : STEP 1:
Create cache. Create Region. Put entries. Close cache. STEP 2: Create cache. Create Region with
the same name as that of in STEP 1. Delete some entries. 3) Recreate the deleted entries Close
the Cache * 3: Again Create cache. 4) check if the region creation is successful
geode-core/src/integrationTest/java/org/apache/geode/internal/cache/DiskRandomOperationsAndRecoveryJUnitTest.java