StringUtils { public static String[] unescapedSplit(String str, char splitChar) { return unescapedSplit(str, splitChar, Integer.MAX_VALUE); } private  StringUtils(); static String byteArrayToHex(byte[] array); static void appendHexFixedLength(char ch, StringBuilder result); static String emptyForNull(String str); static String stripSeperatorsFromEnd(String str); static String[] splitText(String text, String delimiters); static String[] splitLines(String text); static List<String> toLines(String output); static String[] splitBySpaces(String text); static String getTopMostClassName(String className); static String getResourceAsString(String resourcePath, Charset encoding); static String getOsLineSeparator(); static String replaceLFWithPreferredLineSeparator(String str); static String replaceLFWithPreferredLineSeparator(String str, Project ownerProject); static void writeStringToFile(String content, Charset encoding, Path file); static void writeStringToFile(String content, Charset encoding, File file); static int unescapedIndexOf(String str, int startIndex, char toFind); static String unescapeString(String str); static String[] unescapedSplit(String str, char splitChar); static String[] unescapedSplit(String str, char splitChar, int maxSplitCount); static String capitalizeFirstCharacter(String str); static List<String> splitArgs(String cmdLine); static final Collator STR_CMP; static final Charset UTF8; }
@Test public void testUnescapedSplitWithEscaped1() { assertArrayEquals( new String[]{"one", "two\\:three"}, StringUtils.unescapedSplit("one:two\\:three", ':')); }
@Test public void testUnescapedSplitWithEscaped2() { assertArrayEquals( new String[]{"one", "two\\\\\\:three"}, StringUtils.unescapedSplit("one:two\\\\\\:three", ':')); }
@Test public void testUnescapedSplitSimpleWithEscapedEscape() { assertArrayEquals( new String[]{"one\\\\", "two"}, StringUtils.unescapedSplit("one\\\\:two", ':')); }
@Test public void testUnescapedSplitLimitedToOne() { assertArrayEquals( new String[]{"one:two:three"}, StringUtils.unescapedSplit("one:two:three", ':', 1)); }
@Test public void testUnescapedSplitLimitedSimple() { assertArrayEquals( new String[]{"one", "two:three"}, StringUtils.unescapedSplit("one:two:three", ':', 2)); }
@Test public void testUnescapedSplitLimitedEndsWithSeparator1() { assertArrayEquals( new String[]{"one", ""}, StringUtils.unescapedSplit("one:", ':', 2)); }
@Test public void testUnescapedSplitLimitedEndsWithSeparator2() { assertArrayEquals( new String[]{"one", "two:"}, StringUtils.unescapedSplit("one:two:", ':', 2)); }
@Test public void testUnescapedSplitSimple() { assertArrayEquals( new String[]{"one", "two"}, StringUtils.unescapedSplit("one:two", ':')); }
@Test public void testUnescapedSplitEmptyEnd() { assertArrayEquals( new String[]{"one", "two", ""}, StringUtils.unescapedSplit("one:two:", ':')); }
@Test public void testUnescapedSplitEmptyStart() { assertArrayEquals( new String[]{"", "one", "two"}, StringUtils.unescapedSplit(":one:two", ':')); }
@Test public void testUnescapedSplitNoSplit() { assertArrayEquals( new String[]{"single"}, StringUtils.unescapedSplit("single", ':')); }
@Test public void testUnescapedSplitEmpty() { assertArrayEquals( new String[]{""}, StringUtils.unescapedSplit("", ':')); }