@Test
  public void testSuspendResume() throws Exception {
    final CacheTransactionManager mgr = cache.getCacheTransactionManager();
    mgr.begin();
    region.put("key", "value");
    assertEquals("value", region.get("key"));
    final TransactionId txId = mgr.suspend();
    mgr.resume(txId);
    try {
      mgr.resume(txId);
      fail("expected ex not thrown");
    } catch (IllegalStateException ignored) {
    }
    final CountDownLatch latch = new CountDownLatch(1);
    final CountDownLatch latch2 = new CountDownLatch(1);
    Thread t = new Thread(() -> {
      try {
        mgr.resume(txId);
        fail("expected exception not thrown");
      } catch (IllegalStateException ignored) {
      }
      assertFalse(mgr.tryResume(txId));
      latch.countDown();
      assertTrue(mgr.tryResume(txId, 100, TimeUnit.MILLISECONDS));
      assertEquals("value1", region.get("key1"));
      region.put("key2", "value2");
      latch2.countDown();
      assertEquals(txId, mgr.suspend());
    });
    t.start();
    latch.await();
    region.put("key1", "value1");
    assertEquals(txId, mgr.suspend());
    latch2.await();
    assertTrue(mgr.tryResume(txId, 100, TimeUnit.MILLISECONDS));
    assertEquals("value2", region.get("key2"));
    t.join();
    mgr.commit();
    assertEquals(3, region.size());
  }
two threads suspend and resume a single transaction, while making changes.
geode-core/src/integrationTest/java/org/apache/geode/internal/cache/TXManagerImplJUnitTest.java