### Question:
Chars { public static boolean endsWith(CharSequence cs, CharSequence ends) { if (ends == null || cs == null) { return false; } int l = ends.length(); if (l == 0) { return false; } int csl = cs.length(); return !(csl == 0 || csl < l) && equals(ends, cs, csl - l, csl); } private  Chars(); static void asciiCopyTo(char[] chars, int start, int len, long dest); static void asciiStrCpy(final CharSequence value, final int len, final long address); static void asciiStrCpy(final CharSequence value, int lo, final int len, final long address); static int compare(CharSequence l, CharSequence r); static int compareDescending(CharSequence l, CharSequence r); static boolean contains(CharSequence sequence, CharSequence term); static boolean endsWith(CharSequence cs, CharSequence ends); static boolean endsWith(CharSequence cs, char c); static boolean equals(CharSequence l, CharSequence r); static boolean equals(CharSequence l, CharSequence r, int rLo, int rHi); static boolean equals(CharSequence l, int lLo, int lHi, CharSequence r, int rLo, int rHi); static boolean equals(CharSequence l, char r); static boolean equalsIgnoreCase(CharSequence l, CharSequence r); static boolean equalsIgnoreCaseNc(CharSequence l, CharSequence r); static boolean equalsLowerCaseAscii(CharSequence l, int lLo, int lHi, CharSequence r, int rLo, int rHi); static boolean equalsLowerCaseAscii(@NotNull CharSequence l, CharSequence r); static boolean equalsLowerCaseAsciiNc(@Nullable CharSequence l, @NotNull CharSequence r); static boolean equalsNc(CharSequence l, char r); static boolean equalsNc(CharSequence l, CharSequence r); static int hashCode(CharSequence value, int lo, int hi); static int hashCode(CharSequence value); static int indexOf(CharSequence s, char c); static int indexOf(CharSequence s, final int lo, char c); static boolean isMalformed3(int b1, int b2, int b3); static boolean isMalformed4(int b2, int b3, int b4); static boolean isNotContinuation(int b); static boolean isQuote(char c); static boolean isQuoted(CharSequence s); static int lastIndexOf(CharSequence s, char c); static int lowerCaseAsciiHashCode(CharSequence value, int lo, int hi); static int lowerCaseAsciiHashCode(CharSequence value); static boolean noMatch(CharSequence l, int llo, int lhi, CharSequence r, int rlo, int rhi); static ObjList<Path> splitLpsz(CharSequence args); static boolean startsWith(CharSequence _this, CharSequence that); static boolean startsWith(CharSequence _this, int thisLo, int thisHi, CharSequence that); static boolean startsWith(CharSequence _this, char c); static String stringFromUtf8Bytes(long lo, long hi); static String toLowerCaseAscii(@Nullable CharSequence value); static char toLowerCaseAscii(char character); static void toSink(BinarySequence sequence, CharSink sink); static String toString(CharSequence s); static String toString(CharSequence cs, int start, int end); static boolean utf8Decode(long lo, long hi, CharSink sink); static int utf8DecodeMultiByte(long lo, long hi, int b, CharSink sink); static int utf8DecodeMultiByteZ(long lo, int b, CharSink sink); static boolean utf8DecodeZ(long lo, CharSink sink); static final Comparator<CharSequence> CHAR_SEQUENCE_COMPARATOR; static final Comparator<CharSequence> CHAR_SEQUENCE_COMPARATOR_DESC; }### Answer:
@Test public void testEndsWith() { Assert.assertFalse(Chars.endsWith(null, null)); Assert.assertFalse(Chars.endsWith("a", null)); Assert.assertFalse(Chars.endsWith(null, "a")); Assert.assertFalse(Chars.endsWith("", "a")); Assert.assertFalse(Chars.endsWith("a", "")); Assert.assertFalse(Chars.endsWith("ab", "abc")); Assert.assertFalse(Chars.endsWith("abc", "x")); Assert.assertTrue(Chars.endsWith("abcd", "cd")); }