private void lockTheLocks(MemberVM thisVM, final MemberVM thatVM,
      FileBasedCountDownLatch countDownLatch) {
    thisVM.invokeAsync(() -> {
      LOCK.lock();
      countDownLatch.countDown();
      countDownLatch.await();
      // At this point each VM will hold its own lock.
      lockRemoteVM(thatVM);
      LOCK.unlock();
    });
  }
Distributed test base for show deadlock command in {@link ShowDeadlockCommand}.
geode-dunit/src/main/java/org/apache/geode/management/internal/cli/commands/ShowDeadlockDistributedTestBase.java