private void awaitRegionExpiration(Region region) {
    InternalRegion internalRegion = (InternalRegion) region;
    try {
      ExpirationDetector detector;
      do {
        detector = new ExpirationDetector(internalRegion.getRegionTTLExpiryTask() != null
            ? internalRegion.getRegionTTLExpiryTask() : internalRegion.getRegionIdleExpiryTask());
        ExpiryTask.expiryTaskListener = detector;
        ExpiryTask.permitExpiration();
        detector.awaitExecuted(30, SECONDS);
      } while (!detector.hasExpired() && detector.wasRescheduled());
    } finally {
      ExpiryTask.expiryTaskListener = null;
    }
  }
Tests transaction expiration functionality

@since GemFire 4.0
geode-core/src/integrationTest/java/org/apache/geode/TXExpirationIntegrationTest.java