@Test
  public void testRemoteTxCleanupOnCrash() {
    Host host = Host.getHost(0);
    VM accessor = host.getVM(0);
    VM datastore = host.getVM(1);
    initAccessorAndDataStore(accessor, datastore, 0);

    accessor.invoke(new SerializableCallable<Object>() {
      @Override
      public Object call() {
        Region cust = getCache().getRegion(CUSTOMER);
        TXManagerImpl mgr = getCache().getTxManager();
        mgr.begin();
        cust.put(new CustId(6), new Customer("customer6", "address6"));
        return null;
      }
    });
    final InternalDistributedMember member =
        (InternalDistributedMember) accessor.invoke(new SerializableCallable<Object>() {
          @Override
          public Object call() {
            return getCache().getMyId();
          }
        });
    datastore.invoke(new SerializableCallable<Object>() {
      @Override
      public Object call() {
        TXManagerImpl mgr = getCache().getTxManager();
        assertThat(mgr.hostedTransactionsInProgressForTest()).isOne();
        mgr.memberDeparted(getCache().getDistributionManager(), member, true);
        assertThat(mgr.hostedTransactionsInProgressForTest()).isZero();
        return null;
      }
    });
  }
@return first key found on the given member
geode-core/src/distributedTest/java/org/apache/geode/internal/cache/RemoteTransactionDUnitTest.java