code: public static boolean endsWith(String str, char ch) {
          return str != null &&
                 str.length() > 0 &&
                 str.charAt(str.length() - 1) == ch;
      }
docs: Indicate if the given string ends with the given character. This is essentially
  the same as {@link String#endsWith(String)} except that it tests for ending with
  a character instead of a String. False is returned if the given string is null,
  empty, or its last character does not match ch.
  
  @param str   String to be tested.
  @param ch    Char to test for.
  @return      True if the string's last character is ch.