code: public static MemcachedClient create(
              String hosts,
              CommandFactory protocol,
              String user,
              String pass,
              String[] authMechanisms) {
          MemcachedClient client = null;
          try {
              MemcachedClientBuilder builder = new XMemcachedClientBuilder(AddrUtil.getAddresses(hosts));
              builder.setCommandFactory(protocol);
              if (isNotNullOrEmpty(user)) {
                  builder.addAuthInfo(
                          AddrUtil.getAddresses(hosts).get(0),
                          new AuthInfo(
                                  new PlainCallbackHandler(user, pass),
                                  authMechanisms));
              }
              client = builder.build();
          } catch (IOException ex) {
              log.error("An error occurred when creating the MemcachedClient.", ex);
              throw new PippoRuntimeException(ex);
          }
          return client;
      }
docs: Create a memcached client with params.
  
  @param hosts whitespace separated host or IP addresses and port numbers
  of the form "host:port host2:port hostN:portN"
  @param protocol opcional, BINARY or TEXT
  @param user opcional, user name o null
  @param pass opcional, password o null
  @param authMechanisms opcional, CRAM-MD5 and/or PLAIN
  @return memcached client