@Test public void testRemoveTrailingAndLeading() { ConvertString convertString = new ConvertString(); Assert.assertEquals(expected, convertString.removeTrailingAndLeading(expected)); Assert.assertEquals(expected, convertString.removeTrailingAndLeading(" abc")); Assert.assertEquals(expected, convertString.removeTrailingAndLeading(" abc ")); Assert.assertEquals(expected, convertString.removeTrailingAndLeading(" abc ")); Assert.assertEquals(expected, convertString.removeTrailingAndLeading(" abc ")); Assert.assertEquals(expected, convertString.removeTrailingAndLeading(" abc ")); Assert.assertEquals("ab c", convertString.removeTrailingAndLeading(" ab c")); Assert.assertEquals("a b c", convertString.removeTrailingAndLeading(" a b c ")); Assert.assertEquals(expected, convertString.removeTrailingAndLeading("\t" + expected, "\t")); Assert.assertEquals(expected, convertString.removeTrailingAndLeading(expected + "\t", "\t")); Assert.assertEquals(expected, convertString.removeTrailingAndLeading('\u0009' + expected, "\t")); Assert.assertEquals(expected, convertString.removeTrailingAndLeading('\u0009' + expected, '\u0009' + "")); Assert.assertEquals(expected, convertString.removeTrailingAndLeading('\u0009' + expected + '\u0009' + '\u0009', "\t")); Assert.assertEquals("abc ", convertString.removeTrailingAndLeading("\t" + "abc ", "\t")); Assert.assertEquals("a" + "\t" + "bc", convertString.removeTrailingAndLeading("\t" + "a" + "\t" + "bc", "\t")); Assert.assertEquals("\t" + expected, convertString.removeTrailingAndLeading("\t" + "abc ")); Assert.assertEquals(expected, ("\t" + "abc ").trim()); Assert.assertEquals(expected, convertString.removeTrailingAndLeading("\n" + expected, "\n")); Assert.assertEquals("abc ", convertString.removeTrailingAndLeading("\n" + "abc ", "\n")); Assert.assertEquals(expected, convertString.removeTrailingAndLeading(expected, "\r")); Assert.assertEquals(expected, convertString.removeTrailingAndLeading("\r" + expected, "\r")); Assert.assertEquals(expected, convertString.removeTrailingAndLeading("\r" + expected + "\r", "\r")); Assert.assertEquals("abc ", convertString.removeTrailingAndLeading("\r" + "abc ", "\r")); Assert.assertEquals("abc ", convertString.removeTrailingAndLeading("\r" + "abc " + "\r", "\r")); Assert.assertEquals("bc", convertString.removeTrailingAndLeading(" abc", " a")); Assert.assertEquals(" a", convertString.removeTrailingAndLeading(" abc", "bc")); Assert.assertEquals("ab", convertString.removeTrailingAndLeading("cabc", "c")); }
public String removeTrailingAndLeading(String input) { return removeTrailingAndLeading(input, " "); }
ConvertString { public String removeTrailingAndLeading(String input) { return removeTrailingAndLeading(input, " "); } }
ConvertString { public String removeTrailingAndLeading(String input) { return removeTrailingAndLeading(input, " "); } ConvertString();  ConvertString(String repeatStr); }
ConvertString { public String removeTrailingAndLeading(String input) { return removeTrailingAndLeading(input, " "); } ConvertString();  ConvertString(String repeatStr); String removeTrailingAndLeadingWhitespaces(String input); String removeTrailingAndLeading(String input); String removeTrailingAndLeading(String input, String character); String removeRepeatedChar(String input); String removeRepeatedWhitespaces(String input); }
ConvertString { public String removeTrailingAndLeading(String input) { return removeTrailingAndLeading(input, " "); } ConvertString();  ConvertString(String repeatStr); String removeTrailingAndLeadingWhitespaces(String input); String removeTrailingAndLeading(String input); String removeTrailingAndLeading(String input, String character); String removeRepeatedChar(String input); String removeRepeatedWhitespaces(String input); static final String[] WHITESPACE_CHARS; }