code: private boolean checkChecksumISBN10(final String isbn) {
      int sum = 0;
      for (int i = 0; i < isbn.length() - 1; i++) {
        sum += (isbn.charAt(i) - '0') * (i + 1);
      }
      final char checkSum = isbn.charAt(9);
      return sum % 11 == (checkSum == 'X' ? 10 : checkSum - '0');
    }
docs: Check the digits for ISBN 10 using algorithm from <a href=
  "https://en.wikipedia.org/wiki/International_Standard_Book_Number#ISBN-10_check_digits">Wikipedia</a>.