class CookieExtractor implements CredentialsExtractor {

    private final String cookieName;

    /**
     * <p>Constructor for CookieExtractor.</p>
     *
     * @param cookieName a {@link String} object
     */
    public CookieExtractor(final String cookieName) {
        this.cookieName = cookieName;
    }

    /** {@inheritDoc} */
    @Override
    public Optional<Credentials> extract(final CallContext ctx) {<FILL_FUNCTION_BODY>}
}

        val col = ctx.webContext().getRequestCookies();
        for (val c : col) {
            if (c.getName().equals(this.cookieName)) {
                return Optional.of(new TokenCredentials(c.getValue()));
            }
        }
        return Optional.empty();
    
<no_super_class>