### Question:
XSLTHelper { public static String summariseAsLine(String value, int maximumCharacters) { final StringBuilder result = new StringBuilder(value.length()); if (value.length() > maximumCharacters) { result.append(value.substring(0, maximumCharacters)); result.append("..."); } else { result.append(value); } for (int i = 0; i < result.length(); ++i) { final char c = result.charAt(i); if (c == '\t') { result.replace(i, i + 1, "\\t"); } else if (c == '\r') { result.replace(i, i + 1, "\\r"); } else if (c == '\n') { result.replace(i, i + 1, "\\n"); } else if (Character.isISOControl(c)) { result.setCharAt(i, '.'); } } return result.toString(); } XSLTHelper(); static String formatTime(String iso8601); static String quoteForPython(String value); static String quoteEOLEscapedStringForPython(String value); static String quoteForClojure(String value); static String quoteEOLEscapedStringForClojure(String value); static String summariseAsLine(String value, int maximumCharacters); static String escape(String value); static String indent(); static String newLine(); static String newLineAndIndent(); static String changeIndent(int indentChange); static String resetIndent(); static String base64ToPython(String base64String); static String base64ToClojure(String base64String); static void setIndentString(String indentString);  }### Answer:
@Test public void testSummariseAsLine() throws Exception { assertEquals("blah, blah", XSLTHelper.summariseAsLine("blah, blah", 20)); assertEquals("blah,...", XSLTHelper.summariseAsLine("blah, blah", 5)); assertEquals("blah,\\nblah", XSLTHelper.summariseAsLine("blah,\nblah", 20)); assertEquals("\\r blah,\\t", XSLTHelper.summariseAsLine("\r blah,\t", 20)); assertEquals("..bla...", XSLTHelper.summariseAsLine("\0\0blah", 5)); }