code: public boolean isValid(final CharSequence value, final ConstraintValidatorContext context) {
      if (value == null) {
        return true;
      }
  
      final String valueAsString = value.toString();
      String digitsAsString;
      char checkDigit;
      try {
        digitsAsString = this.extractVerificationString(valueAsString);
        checkDigit = this.extractCheckDigit(valueAsString);
      } catch (final IndexOutOfBoundsException e) {
        return false;
      }
      digitsAsString = this.stripNonDigitsIfRequired(digitsAsString);
  
      List<Integer> digits;
      try {
        digits = this.extractDigits(digitsAsString);
      } catch (final NumberFormatException e) {
        return false;
      }
  
      return this.isCheckDigitValid(digits, checkDigit);
    }
docs: valid check.
  
  @param value value to check.
  @param context constraint validator context
  @return true if valid