code: public static TreeSet<Integer> getUsableLocalPorts(int numRequested, int minPort, int maxPort) {
  		final TreeSet<Integer> availablePorts = new TreeSet<>();
  		int attemptCount = 0;
  		while ((++attemptCount <= numRequested + 100) && availablePorts.size() < numRequested) {
  			availablePorts.add(getUsableLocalPort(minPort, maxPort));
  		}
  
  		if (availablePorts.size() != numRequested) {
  			throw new UtilException("Could not find {} available  ports in the range [{}, {}]", numRequested, minPort, maxPort);
  		}
  
  		return availablePorts;
  	}
docs: 获取多个本地可用端口<br>
  来自org.springframework.util.SocketUtils
  
  @param minPort 端口最小值（包含）
  @param maxPort 端口最大值（包含）
  @return 可用的端口
  @since 4.5.4