public static int getRandomAvailablePort(int protocol) {
    return getRandomAvailablePort(protocol, getAddress(protocol));
  }
Returns a randomly selected available port in the range 5001 to 32767.

@param protocol The protocol to check (either {@link #SOCKET} or {@link #MULTICAST}).
@throws IllegalArgumentException <code>protocol</code> is unknown
geode-membership/src/main/java/org/apache/geode/internal/membership/utils/AvailablePort.java