code: static public int getFreeServerPort(boolean tryOthers, int... ports){
  		for (int port: ports){
  			if (isServerPortFree(port)){
  				return port;
  			}
  		}
  		return tryOthers? getFreeServerPort() : 0;
  	}
docs: Get a free server port that can be used.
  Several preferred port numbers can be specified.
  @param tryOthers  If all preferred ports are occupied, try other free ports or not.
  @param ports	preferred port numbers
  @return	A free port number, or zero if not found or exception occurred.