code: public static SaslClient createSaslClient(String[] mechanisms, String authorizationId, String protocol,
          String serverName, Map<String, ?> props, CallbackHandler cbh) throws SaslException {
  
          boolean enableScram = Boolean.parseBoolean(System.getProperty("com.couchbase.scramEnabled", "true"));
  
          for (String mech : mechanisms) {
              String[] mechs = new String[] { mech };
  
              SaslClient client = javax.security.sasl.Sasl.createSaslClient(
                  mechs, authorizationId, protocol, serverName, props, cbh
              );
  
              if (client == null && enableScram) {
                  client = SASL_FACTORY.createSaslClient(
                      mechs, authorizationId, protocol, serverName, props, cbh
                  );
              }
  
              if (client != null) {
                  return client;
              }
          }
  
          return null;
      }
docs: Creates a new {@link SaslClient} and first tries the JVM built in clients before falling back
  to our custom implementations. The mechanisms are tried in the order they arrive.