### Question:
StaticStringUtils { public static String justOneCR(String strIn) { StringBuilder sb = new StringBuilder(); String[] Strs = strIn.split("\n"); for (String str : Strs) { sb.append(str); } sb.append("\n"); return sb.toString(); }  static String lpadLong(long val, String pad, int npad); static String lpad(String val, String pad, int npad); static String getExtendedStackTrace(Throwable th); static String mapToString(Map<K, V> map, String delimiter); static String collectionToString(Collection<T> collection, String delimiter); static String truncate(String stringIn, int maxLen); static String mapToString(Map<K, V> mapIn); static String stripCRLF(String line); static String[] stripBlankArgs(String line); static Map<String, String> argMapper(String[] args); static String[] stripKwArgs(String[] args); static String justOneCR(String strIn); static String showDiff(String a, String b);  }### Answer:
@Test public void testJustOneCR() { assertEquals(StaticStringUtils.justOneCR("123"), "123\n"); assertEquals(StaticStringUtils.justOneCR("123\n"), "123\n"); assertEquals(StaticStringUtils.justOneCR("123\n\n"), "123\n"); assertEquals(StaticStringUtils.justOneCR(""), "\n"); assertEquals(StaticStringUtils.justOneCR("1\n2\n3\n"), "123\n"); }