@Test
  public void afterCreateVmIsInvokedForMultipleNewlyCreatedVms() {
    // getVM implicitly creates intervening VMs between beforeVmCount and beforeVmCount+2
    getVM(beforeVmCount + 2);

    verify(distributedRule, times(3)).afterCreateVM(vmCaptor.capture());
    assertThat(vmCaptor.getAllValues()).containsExactly(getVM(beforeVmCount),
        getVM(beforeVmCount + 1), getVM(beforeVmCount + 2));
  }
Distributed tests for {@link VMEventListener} callbacks.
geode-dunit/src/distributedTest/java/org/apache/geode/test/dunit/rules/tests/VmEventListenerDistributedTest.java