CharUtils { public static String[] splitByDot(String input) { ArrayList<String> splitList = new ArrayList<String>(); StringBuilder section = new StringBuilder(); if (StringUtils.isEmpty(input)) { return new String[] { "" }; } InputTextReader reader = new InputTextReader(input); while (!reader.eof()) { char curr = reader.read(); if (isDot(curr)) { splitList.add(section.toString()); section.setLength(0); } else if (curr == '%' && reader.canReadChars(2) && reader.peek(2).equalsIgnoreCase("2e")) { reader.read(); reader.read(); splitList.add(section.toString()); section.setLength(0); } else { section.append(curr); } } splitList.add(section.toString()); return splitList.toArray(new String[splitList.size()]); } private  CharUtils(); static boolean isHex(char a); static boolean isAlpha(char a); static boolean isNumeric(char a); static boolean isAlphaNumeric(char a); static boolean isUnreserved(char a); static boolean isDot(char a); static boolean isWhiteSpace(char a); static String[] splitByDot(String input);  }
@Test(dataProvider = "getSplitStrings") public void testSplitByDot(String stringToSplit) { Assert .assertEquals(CharUtils.splitByDot(stringToSplit), stringToSplit.split("[\\.\u3002\uFF0E\uFF61]|%2e|%2E", -1)); }