### Question:
Logging { public static String sanitise(String input) { return input.replaceAll("\\n", "\\\\n"); } private  Logging(); static String sanitise(String input);  }### Answer:
@Test public void sanitiseRemovesNewlines() throws Exception { assertThat(Logging.sanitise("first line\nsecond line"), is("first line\\nsecond line")); }