class MellonHeaderDecoder implements IUserDecoder {

    private static final Logger LOGGER = Logger.getLogger(MellonHeaderDecoder.class.getName());

    static final String MELLON_EMAIL_HEADER = "MELLON_email";
    static final String MELLON_USERNAME_HEADER = "MELLON_username";

    @Override
    public User fromRequest(HttpServletRequest request) {<FILL_FUNCTION_BODY>}
}

        // e-mail is mandatory.
        String id = request.getHeader(MELLON_EMAIL_HEADER);
        if (id == null || id.isEmpty()) {
            LOGGER.log(Level.WARNING,
                    "Can not construct User object: header ''{1}'' not found in request headers: {0}",
                    new Object[]{String.join(",", Collections.list(request.getHeaderNames())),
                            MELLON_EMAIL_HEADER});
            return null;
        }

        // username is optional.
        String username = request.getHeader(MELLON_USERNAME_HEADER);

        return new User(username, id);
    
<no_super_class>