### Question:
EagleEyeCoreUtils { public static StringBuilder appendLog(String str, StringBuilder appender, char delimiter) { if (str != null) { int len = str.length(); appender.ensureCapacity(appender.length() + len); for (int i = 0; i < len; i++) { char c = str.charAt(i); if (c == '\n' || c == '\r' || c == delimiter) { c = ' '; } appender.append(c); } } return appender; }  static boolean isBlank(String str); static String checkNotNullEmpty(String value, String name); static T checkNotNull(T value, String name); static T defaultIfNull(T value, T defaultValue); static boolean isNotBlank(String str); static boolean isNotEmpty(String str); static String trim(String str); static String[] split(String str, char separatorChar); static StringBuilder appendWithBlankCheck(String str, String defaultValue, StringBuilder appender); static StringBuilder appendWithNullCheck(Object obj, String defaultValue, StringBuilder appender); static StringBuilder appendLog(String str, StringBuilder appender, char delimiter); static String formatTime(long timestamp); static String getSystemProperty(String key); static long getSystemPropertyForLong(String key, long defaultValue); static boolean isHexNumeric(char ch); static boolean isNumeric(char ch); static void shutdownThreadPool(ExecutorService pool, long awaitTimeMillis); @SuppressWarnings("restriction") static sun.misc.Unsafe getUnsafe(); static final String EMPTY_STRING; static final String NEWLINE; static final String[] EMPTY_STRING_ARRAY; }### Answer:
@Test public void testAppendLog() { Assert.assertEquals("foo bar baz foo", EagleEyeCoreUtils.appendLog( "foo\nbar\rbaz,foo", new StringBuilder(), ',').toString()); Assert.assertEquals("", EagleEyeCoreUtils.appendLog( null, new StringBuilder(), ',').toString()); }