code: public static boolean isValid(String sentence) {
          // Compare the characters after the asterisk to the calculation
  
          try {
              return sentence.substring(sentence.lastIndexOf("*") + 1)
                      .equalsIgnoreCase(getChecksum(sentence));
          } catch (AisParseException e) {
              return false;
          }
      }
docs: Returns true if and only if the sentence's checksum matches the
  calculated checksum.
  
  @param sentence
  @return