public static boolean isSaneRequest(HttpServletRequest request) {
        if (request != null && request.getMethod() != null) {
            return true;
        }
        return false;
    }
public static boolean isSaneRequest ( HttpServletRequest request ) { if ( request != null && request . getMethod ( ) != null ) { return true ; } return false ; }
Checks if request and request method are not null

@param request {@link HttpServletRequest} to check
@return true if sane, false otherwise