// Path: src/main/java/com/medium/api/util/StringUtils.java
// public final class StringUtils {
// 
//     /**
//      * Joins the collection of items as a string containing their
//      * representations joined by a separator in between them.
//      *
//      * NOTE: this is available in Java 8, and in numerous libraries
//      * which we aren't using to reduce number of dependencies.
//      *
//      * @param <T> the type of the items to be joined as a string
//      * @param separator the string to use to separate the inputs
//      * @param items the strings that should be joined
//      *
//      * @return the joined version of the input strings
//      */
//     public static <T> String join(final String separator,
//             final Collection<T> items) {
// 
//         StringBuilder builder = new StringBuilder();
// 
//         for (T item : items) {
//             if (builder.length() > 0) {
//                 builder.append(separator);
//             }
// 
//             builder.append(item.toString());
//         }
// 
//         return builder.toString();
//     }
// }


import com.medium.api.util.StringUtils;
import java.util.Collection;
    public AuthorizationCodeRequestBuilder withResponseType(final String responseType) {
        this.responseType = responseType;
        return this;
    }

    /**
     * Sets the URL to which the user will be redirected upon
     * logging in.
     *
     * @param redirectUri the redirect uri
     *
     * @return the updated instance of the current builder
     */
    public AuthorizationCodeRequestBuilder withRedirectUri(final String redirectUri) {
        this.redirectUri = redirectUri;
        return this;
    }

    /**
     * Gets the Request as a GET-able uri.
     *
     * TODO: there are cleaner implementations of this possible using
     * libraries.
     *
     * @return returns the Uri for the authorization request.
     */
    public String asUri() {
        return String.format("%s?%s=%s&%s=%s&%s=%s&%s=%s&%s=%s",
            endpoint,
            Key.CLIENT_ID, clientId,
// Path: src/main/java/com/medium/api/util/StringUtils.java
// public final class StringUtils {
// 
//     /**
//      * Joins the collection of items as a string containing their
//      * representations joined by a separator in between them.
//      *
//      * NOTE: this is available in Java 8, and in numerous libraries
//      * which we aren't using to reduce number of dependencies.
//      *
//      * @param <T> the type of the items to be joined as a string
//      * @param separator the string to use to separate the inputs
//      * @param items the strings that should be joined
//      *
//      * @return the joined version of the input strings
//      */
//     public static <T> String join(final String separator,
//             final Collection<T> items) {
// 
//         StringBuilder builder = new StringBuilder();
// 
//         for (T item : items) {
//             if (builder.length() > 0) {
//                 builder.append(separator);
//             }
// 
//             builder.append(item.toString());
//         }
// 
//         return builder.toString();
//     }
// }


// Path: src/main/java/com/medium/api/auth/AuthorizationCodeRequestBuilder.java
import com.medium.api.util.StringUtils;
import java.util.Collection;

    public AuthorizationCodeRequestBuilder withResponseType(final String responseType) {
        this.responseType = responseType;
        return this;
    }

    /**
     * Sets the URL to which the user will be redirected upon
     * logging in.
     *
     * @param redirectUri the redirect uri
     *
     * @return the updated instance of the current builder
     */
    public AuthorizationCodeRequestBuilder withRedirectUri(final String redirectUri) {
        this.redirectUri = redirectUri;
        return this;
    }

    /**
     * Gets the Request as a GET-able uri.
     *
     * TODO: there are cleaner implementations of this possible using
     * libraries.
     *
     * @return returns the Uri for the authorization request.
     */
    public String asUri() {
        return String.format("%s?%s=%s&%s=%s&%s=%s&%s=%s&%s=%s",
            endpoint,
            Key.CLIENT_ID, clientId,
            Key.SCOPE, StringUtils.join(",", scopes),