public static boolean invalidCaptcha(final String captcha,final HttpServletRequest request){
  final HttpSession session=request.getSession(false);
  if (null == session) {
    return true;
  }
  if (Strings.isEmptyOrNull(captcha) || captcha.length() != CAPTCHA_LENGTH) {
    return true;
  }
  final String storedCaptcha=(String)session.getAttribute(CaptchaProcessor.CAPTCHA);
  if (null == storedCaptcha || !storedCaptcha.equals(captcha)) {
    return true;
  }
  session.removeAttribute(CaptchaProcessor.CAPTCHA);
  return false;
}

public static boolean invalidCaptcha ( final String captcha , final HttpServletRequest request ) { final HttpSession session = request . getSession ( false ) ; if ( null == session ) { return true ; } if ( Strings . isEmptyOrNull ( captcha ) || captcha . length ( ) != CAPTCHA_LENGTH ) { return true ; } final String storedCaptcha = ( String ) session . getAttribute ( CaptchaProcessor . CAPTCHA ) ; if ( null == storedCaptcha || ! storedCaptcha . equals ( captcha ) ) { return true ; } session . removeAttribute ( CaptchaProcessor . CAPTCHA ) ; return false ; }
checks whether the specified captcha is invalid .
