### Question:
StringUtility { public static String prettyPrint(String in, int lineLength, String delim) { StringBuilder sb = new StringBuilder(in.length() + in.length()/lineLength); if (delim == null) { delim = " "; } StringTokenizer st = new StringTokenizer(in, delim); int charCount = 0; while (st.hasMoreTokens()) { String s = st.nextToken(); charCount = charCount + s.length(); if (charCount < lineLength) { sb.append(s); sb.append(' '); charCount++; } else { sb.append('\n'); sb.append(s); sb.append(' '); charCount = s.length() + 1; } } return sb.toString(); } StringUtility(); static String prettyPrint(String in, int lineLength, String delim); @Deprecated static String splitAndIndent(String str, int indent, int numChars); static void splitAndIndent(String str, int indent,
            int numChars, PrintWriter writer); static String byteArraytoHexString(byte[] array); static byte[] hexStringtoByteArray(String str); static void main(String[] args);  }### Answer:
@Test public void testPrettyPrint() { String src = "The;quick;brown;fox;jumped;over;the;lazy;dog"; String expected = "\n" + src.replace(";"," \n") + " "; assertEquals(expected, StringUtility.prettyPrint(src, 2, ";")); }