public static int getServerPort(VM vm) {
    if (vm == server1) {
      return PORT1;
    } else if (vm == server2) {
      return PORT2;
    } else if (vm == server3) {
      return PORT3;
    } else {
      fail("expected vm " + vm + " to be " + server1 + ", or " + server2 + ", or " + server3);
      return -1;
    }
  }
Given a server vm (server1, server2, or server3) return its port.

@since GemFire 5.7
geode-core/src/distributedTest/java/org/apache/geode/internal/cache/tier/sockets/HAInterestTestCase.java