private Region concurrencyTest(Region r1) {
    if (validate) {
      for (int i = 0; i < 10; i++) {
        map.put(i, new ReentrantLock());
      }
      region2 =
          cache.createVMRegion("testRegion2", new AttributesFactory().createRegionAttributes());
    }
    startLine = new CyclicBarrier(numberOfPutsThreads + numberOfGetsThreads
        + numberOfDestroysThreads + numberOfClearThreads + numberOfForceRollThreads);
    DoesPuts doesPuts = new DoesPuts();
    DoesGets doesGets = new DoesGets();
    DoesDestroy doesDestroy = new DoesDestroy();
    DoesClear doesClear = new DoesClear();
    DoesForceRoll doesForceRoll = new DoesForceRoll();
    Thread[] putThreads = new Thread[numberOfPutsThreads];
    Thread[] getThreads = new Thread[numberOfGetsThreads];
    Thread[] destroyThreads = new Thread[numberOfDestroysThreads];
    Thread[] clearThreads = new Thread[numberOfClearThreads];
    Thread[] forceRollThreads = new Thread[numberOfForceRollThreads];
    for (int i = 0; i < numberOfPutsThreads; i++) {
      putThreads[i] = new Thread(doesPuts);
      putThreads[i].setName("PutThread" + i);
    }
    for (int i = 0; i < numberOfGetsThreads; i++) {
      getThreads[i] = new Thread(doesGets);
      getThreads[i].setName("GetThread" + i);
    }
    for (int i = 0; i < numberOfDestroysThreads; i++) {
      destroyThreads[i] = new Thread(doesDestroy);
      destroyThreads[i].setName("DelThread" + i);
    }

    for (int i = 0; i < numberOfClearThreads; i++) {
      clearThreads[i] = new Thread(doesClear);
      clearThreads[i].setName("ClearThread" + i);
    }

    for (int i = 0; i < numberOfForceRollThreads; i++) {
      forceRollThreads[i] = new Thread(doesForceRoll);
      forceRollThreads[i].setName("ForceRoll" + i);
    }
    timeToStop.set(false);
    try {
      for (int i = 0; i < numberOfPutsThreads; i++) {
        putThreads[i].start();
      }
      for (int i = 0; i < numberOfGetsThreads; i++) {
        getThreads[i].start();
      }
      for (int i = 0; i < numberOfDestroysThreads; i++) {
        destroyThreads[i].start();
      }
      for (int i = 0; i < numberOfClearThreads; i++) {
        clearThreads[i].start();
      }
      for (int i = 0; i < numberOfForceRollThreads; i++) {
        forceRollThreads[i].start();
      }
      try {
        Thread.sleep(TIME_TO_RUN);
      } catch (InterruptedException e) {
        fail("interrupted");
      }
    } finally {
      timeToStop.set(true);
    }
    for (int i = 0; i < numberOfPutsThreads; i++) {
      ThreadUtils.join(putThreads[i], 60 * 1000);
    }
    for (int i = 0; i < numberOfGetsThreads; i++) {
      ThreadUtils.join(getThreads[i], 60 * 1000);
    }
    for (int i = 0; i < numberOfDestroysThreads; i++) {
      ThreadUtils.join(destroyThreads[i], 60 * 1000);
    }
    for (int i = 0; i < numberOfClearThreads; i++) {
      ThreadUtils.join(clearThreads[i], 60 * 1000);
    }
    for (int i = 0; i < numberOfForceRollThreads; i++) {
      ThreadUtils.join(forceRollThreads[i], 60 * 1000);
    }

    if (validate) {
      Collection entrySet = region2.entrySet();
      Iterator iterator = entrySet.iterator();
      Map.Entry mapEntry = null;
      Object key, value = null;
      ((LocalRegion) r1).getDiskRegion().forceFlush();
      while (iterator.hasNext()) {
        mapEntry = (Map.Entry) iterator.next();
        key = mapEntry.getKey();
        value = mapEntry.getValue();
        if (!(r1.containsKey(key))) {
          fail(" region1 does not contain Key " + key + " but was expected to be there");
        }
        if (!(((LocalRegion) r1).getValueOnDisk(key).equals(value))) {
          fail(" value for key " + key + " is " + ((LocalRegion) r1).getValueOnDisk(key)
              + " which is not consistent, it is supposed to be " + value);
        }
      }
    }
    r1.close();

    if (exceptionOccurredInDestroys) {
      fail("Exception occurred while destroying");
    }
    if (exceptionOccurredInClears) {
      fail("Exception occurred while clearing");
    }

    if (exceptionOccurredInForceRolls) {
      fail("Exception occurred while force Rolling");
    }

    if (exceptionOccurredInGets) {
      fail("Exception occurred while doing gets");
    }

    if (exceptionOccurredInPuts) {
      fail("Exception occurred while doing puts");
    }

    return region2;
  }
Tests the bug where a get operation on an evicted entry fails to get value as the oplog is
deleted by the roller, but the entry was not rolled.
geode-core/src/integrationTest/java/org/apache/geode/internal/cache/ConcurrentRegionOperationsJUnitTest.java