docs: public MemcachedClient build() throws IOException {
      XMemcachedClient memcachedClient;
      // kestrel protocol use random session locator.
      if (this.commandFactory.getProtocol() == Protocol.Kestrel) {
        if (!(this.sessionLocator instanceof RandomMemcachedSessionLocaltor)) {
          log.warn(
              "Recommend to use `net.rubyeye.xmemcached.impl.RandomMemcachedSessionLocaltor` as session locator for kestrel protocol.");
        }
      }
      if (this.weights == null) {
        memcachedClient = new XMemcachedClient(this.sessionLocator, this.sessionComparator,
            this.bufferAllocator, this.configuration, this.socketOptions, this.commandFactory,
            this.transcoder, this.addressMap, this.stateListeners, this.authInfoMap,
            this.connectionPoolSize, this.connectTimeout, this.name, this.failureMode);
  
      } else {
        if (this.addressMap == null) {
          throw new IllegalArgumentException("Null Address map");
        }
        if (this.addressMap.size() > this.weights.length) {
          throw new IllegalArgumentException("Weights Array's length is less than server's number");
        }
        memcachedClient = new XMemcachedClient(this.sessionLocator, this.sessionComparator,
            this.bufferAllocator, this.configuration, this.socketOptions, this.commandFactory,
            this.transcoder, this.addressMap, this.weights, this.stateListeners, this.authInfoMap,
            this.connectionPoolSize, this.connectTimeout, this.name, this.failureMode);
      }
      this.configureClient(memcachedClient);
      return memcachedClient;
    }