@Test public void testremoveDuplicate_NULL1() { ConvertString convertString = new ConvertString("c"); String input = null; Assert.assertEquals(null, convertString.removeRepeatedChar(input)); input = ""; Assert.assertEquals("", convertString.removeRepeatedChar(input)); }
public String removeRepeatedChar(String input) { if (StringUtils.isEmpty(input) || StringUtils.isEmpty(repeatChar) || removeRepeatCharPattern == null) { return input; } Matcher matcher = removeRepeatCharPattern.matcher(input); return matcher.replaceAll(repeatChar); }
ConvertString { public String removeRepeatedChar(String input) { if (StringUtils.isEmpty(input) || StringUtils.isEmpty(repeatChar) || removeRepeatCharPattern == null) { return input; } Matcher matcher = removeRepeatCharPattern.matcher(input); return matcher.replaceAll(repeatChar); } }
ConvertString { public String removeRepeatedChar(String input) { if (StringUtils.isEmpty(input) || StringUtils.isEmpty(repeatChar) || removeRepeatCharPattern == null) { return input; } Matcher matcher = removeRepeatCharPattern.matcher(input); return matcher.replaceAll(repeatChar); } ConvertString();  ConvertString(String repeatStr); }
ConvertString { public String removeRepeatedChar(String input) { if (StringUtils.isEmpty(input) || StringUtils.isEmpty(repeatChar) || removeRepeatCharPattern == null) { return input; } Matcher matcher = removeRepeatCharPattern.matcher(input); return matcher.replaceAll(repeatChar); } 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 removeRepeatedChar(String input) { if (StringUtils.isEmpty(input) || StringUtils.isEmpty(repeatChar) || removeRepeatCharPattern == null) { return input; } Matcher matcher = removeRepeatCharPattern.matcher(input); return matcher.replaceAll(repeatChar); } 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; }