class UserUtil {

    public CustomUserDetailsUser getUser() {<FILL_FUNCTION_BODY>}

    @SneakyThrows
    public String getUserId() {
        return getUser() == null ? null :getUser().getUserId();
    }

}

        Object object = SecurityContextHolder.getContext().getAuthentication().getPrincipal();
        if(object != null){
            return (CustomUserDetailsUser) object;
        }
        return null;
    
<no_super_class>