### Question:
StringHelper { public static String[] readCommaSeperatedString(String line) { if (line.trim().isEmpty()) { return new String[0]; } List<String> buffer = new LinkedList<String>(); int index = 0; int lastFound = 0; int inBracer = 0; for (char c : line.toCharArray()) { if (c == ',' && inBracer == 0) { buffer.add(line.substring(lastFound, index).trim()); lastFound = index + 1; } if (c == '(') inBracer++; if (c == ')') inBracer--; index++; } buffer.add(line.substring(lastFound, index).trim()); String[] output = new String[0]; if (inBracer == 0) output = buffer.toArray(output); return output; } private  StringHelper(); static String join(final Collection<?> coll, final String glue); static String join(final Object[] list, final String glue); static String toComputerFriendlyName(String name); static int readInt(String string, int minValue, int maxValue); static double readDouble(String string, double minValue, double maxValue); static String[] readCommaSeperatedString(String line); static boolean specifiesBlockData(String materialString); static long readLong(String string, long minValue, long maxValue);  }### Answer:
@Test public void testReadCommaSeperatedString() { assertArrayEquals(StringHelper.readCommaSeperatedString(""), new String[0]); assertArrayEquals(StringHelper.readCommaSeperatedString("a"), new String[] {"a"}); assertArrayEquals(StringHelper.readCommaSeperatedString("a,b,cd"), new String[] {"a", "b", "cd"}); assertArrayEquals(StringHelper.readCommaSeperatedString("a,b(c,d),e"), new String[] {"a", "b(c,d)", "e"}); assertArrayEquals(StringHelper.readCommaSeperatedString("a,b(c,d(e,f),g),h"), new String[] {"a", "b(c,d(e,f),g)", "h"}); assertArrayEquals(StringHelper.readCommaSeperatedString(" "), new String[0]); assertArrayEquals(StringHelper.readCommaSeperatedString("a, b(c,d), e"), new String[] {"a", "b(c,d)", "e"}); assertArrayEquals(StringHelper.readCommaSeperatedString(" a, b(c,d), e "), new String[] {"a", "b(c,d)", "e"}); }