@Test
  public void testMultipleSuspends() throws Exception {
    final CacheTransactionManager mgr = cache.getCacheTransactionManager();
    mgr.begin();
    region.put("key", "value");
    final TransactionId txId = mgr.suspend();
    mgr.resume(txId);
    final CountDownLatch latch = new CountDownLatch(1);
    final CountDownLatch latch2 = new CountDownLatch(1);
    final CountDownLatch latch3 = new CountDownLatch(1);
    Thread t1 = new Thread(() -> {
      latch2.countDown();
      assertTrue(mgr.tryResume(txId, 1, TimeUnit.SECONDS));
      assertNull(region.get("key2"));
      region.put("key1", "value1");
      assertEquals(txId, mgr.suspend());
    });
    Thread t2 = new Thread(() -> {
      latch3.countDown();
      assertTrue(mgr.tryResume(txId, 1, TimeUnit.SECONDS));
      assertEquals("value1", region.get("key1"));
      region.put("key2", "value");
      assertEquals(txId, mgr.suspend());
      latch.countDown();
    });
    t1.start();
    latch2.await();
    Thread.sleep(200);
    t2.start();
    latch3.await();
    Thread.sleep(200);
    mgr.suspend();
    if (!latch.await(30, TimeUnit.SECONDS)) {
      fail("junit test failed");
    }
    mgr.tryResume(txId, 1, TimeUnit.SECONDS);
    assertEquals(3, region.size());
    mgr.commit();
  }
two threads suspend and resume a single transaction, while making changes.
geode-core/src/integrationTest/java/org/apache/geode/internal/cache/TXManagerImplJUnitTest.java