code: public static final MemcachedClient create(
              String hosts,
              Protocol protocol,
              String user,
              String pass,
              String[] authMechanisms) {
  
          MemcachedClient client = null;
          try {
              ConnectionFactory connectionFactory;
              if (isNotNullOrEmpty(user)) {
                  AuthDescriptor authDescriptor = new AuthDescriptor(
                          authMechanisms,
                          new PlainCallbackHandler(user, pass));
                  connectionFactory = new ConnectionFactoryBuilder()
                          .setProtocol(protocol)
                          .setAuthDescriptor(authDescriptor)
                          .build();
              } else {
                  connectionFactory = new ConnectionFactoryBuilder()
                          .setProtocol(protocol)
                          .build();
              }
              client = new MemcachedClient(connectionFactory, AddrUtil.getAddresses(hosts));
          } 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 or comma separated host or IP addresses and port
  numbers of the form "host:port host2:port" or "host:port, host2:port"
  @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