class TwitterClient extends OAuth10Client {

    private boolean alwaysConfirmAuthorization = false;

    private boolean includeEmail = false;

    /**
     * <p>Constructor for TwitterClient.</p>
     */
    public TwitterClient() {}

    /**
     * <p>Constructor for TwitterClient.</p>
     *
     * @param key a {@link String} object
     * @param secret a {@link String} object
     */
    public TwitterClient(final String key, final String secret) {
        this(key, secret, false);
    }

    /**
     * <p>Constructor for TwitterClient.</p>
     *
     * @param key a {@link String} object
     * @param secret a {@link String} object
     * @param includeEmail a boolean
     */
    public TwitterClient(final String key, final String secret, boolean includeEmail) {
        setKey(key);
        setSecret(secret);
        this.includeEmail = includeEmail;
    }

    /** {@inheritDoc} */
    @Override
    protected void internalInit(final boolean forceReinit) {
        configuration.setApi(getApi());
        configuration.setProfileDefinition(new TwitterProfileDefinition(includeEmail));
        configuration.setHasBeenCancelledFactory(ctx -> {
            val denied = ctx.getRequestParameter("denied");
            if (denied.isPresent()) {
                return true;
            } else {
                return false;
            }
        });
        setLogoutActionBuilderIfUndefined((ctx, profile, targetUrl) ->
            Optional.of(HttpActionHelper.buildRedirectUrlAction(ctx.webContext(), "https://twitter.com/logout")));

        super.internalInit(forceReinit);
    }

    /**
     * <p>getApi.</p>
     *
     * @return a {@link DefaultApi10a} object
     */
    protected DefaultApi10a getApi() {<FILL_FUNCTION_BODY>}

    /**
     * <p>isAlwaysConfirmAuthorization.</p>
     *
     * @return a boolean
     */
    public boolean isAlwaysConfirmAuthorization() {
        return this.alwaysConfirmAuthorization;
    }

    /**
     * <p>Setter for the field <code>alwaysConfirmAuthorization</code>.</p>
     *
     * @param alwaysConfirmAuthorization a boolean
     */
    public void setAlwaysConfirmAuthorization(final boolean alwaysConfirmAuthorization) {
        this.alwaysConfirmAuthorization = alwaysConfirmAuthorization;
    }

    /**
     * <p>isIncludeEmail.</p>
     *
     * @return a boolean
     */
    public boolean isIncludeEmail() {
        return includeEmail;
    }

    /**
     * <p>Setter for the field <code>includeEmail</code>.</p>
     *
     * @param includeEmail a boolean
     */
    public void setIncludeEmail(final boolean includeEmail) {
        this.includeEmail = includeEmail;
    }
}

        final DefaultApi10a api;
        if (this.alwaysConfirmAuthorization == false) {
            api = TwitterApi.Authenticate.instance();
        } else {
            api = TwitterApi.instance();
        }
        return api;
    
<methods>public non-sealed void <init>() ,public java.lang.String getKey() ,public java.lang.String getSecret() ,public void setKey(java.lang.String) ,public void setSecret(java.lang.String) <variables>protected org.pac4j.oauth.config.OAuth10Configuration configuration