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