void getAfterFlush(final Region region) {
    alreadyComeHere = false;
    CacheObserverHolder.setInstance(new CacheObserverAdapter() {

      @Override
      public void afterWritingBytes() {
        if (!alreadyComeHere) {
          region.get("key");
        }
        alreadyComeHere = true;
      }
    });
    ((LocalRegion) region).getDiskRegion().pauseFlusherForTesting();
    region.put("Key", "Value1");
    ((LocalRegion) region).getDiskRegion().flushForTesting();
    try {
      assertEquals("Value1", getValueOnDisk(region));
    } catch (EntryNotFoundException e) {
      logWriter.error("Exception occurred", e);
      fail("Entry not found although was supposed to be there");
    }
  }
A region close is done after flush is over. The close is done in a separate thread and a 3000
ms wait is put to ensure that the separate thread has closed the region
geode-core/src/integrationTest/java/org/apache/geode/internal/cache/ConcurrentFlushingAndRegionOperationsJUnitTest.java