Braintree/src/main/java/com/braintreepayments/api/models/Authorization.java
public static Authorization fromString(@Nullable String authorizationString) throws InvalidArgumentException {
        if (isTokenizationKey(authorizationString)) {
            return new TokenizationKey(authorizationString);
        } else {
            return new ClientToken(authorizationString);
        }
    }
public static Authorization fromString(@Nullable String authorizationString) throws InvalidArgumentException {
        if (isTokenizationKey(authorizationString)) {
            return new TokenizationKey(authorizationString);
        } else {
            return new ClientToken(authorizationString);
        }
    }
Returns an {@link Authorization} of the correct type for a given {@link String}.

@param authorizationString Given string to transform into an {@link Authorization}.
@return {@link Authorization}
@throws InvalidArgumentException This method will throw this exception type if the string
passed does not meet any of the criteria supplied for {@link ClientToken} or {@link TokenizationKey}.