CharSequences { public static CharSequence concatenate(final CharSequence first, final CharSequence second) { return new StringBuilder().append(first).append(second); } CharSequences(); static Iterable<CharSequence> generateSuffixes(final CharSequence input); static Iterable<CharSequence> generatePrefixes(final CharSequence input); static CharSequence getCommonPrefix(CharSequence first, CharSequence second); static CharSequence getSuffix(CharSequence input, int startIndex); static CharSequence getPrefix(CharSequence input, int endIndex); static CharSequence subtractPrefix(CharSequence main, CharSequence prefix); static CharSequence concatenate(final CharSequence first, final CharSequence second); static CharSequence reverse(CharSequence input); static CharSequence fromCharArray(final char[] characters); static char[] toCharArray(CharSequence charSequence); static String toString(CharSequence charSequence);  }
@Test public void testConcatenate() throws Exception { CharSequence first = "APPLE"; CharSequence second = "ORANGE"; CharSequence concatenated = CharSequences.concatenate(first, second); Assert.assertEquals("APPLEORANGE", new StringBuilder().append(concatenated).toString()); }