class UserPrincipalDecoder implements IUserDecoder {

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

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

        if (request.getUserPrincipal() == null) {
            return null;
        }

        String username = request.getUserPrincipal().getName();
        if (username == null || username.isEmpty()) {
            LOGGER.log(Level.WARNING,
                    "Can not construct User object: cannot get user principal from: {0}",
                    request);
            return null;
        }

        return new User(username);
    
<no_super_class>