### Question:
ClouderaManagerDatabusService { @VisibleForTesting String trimAndReplacePrivateKey(char[] privateKey) { return new String(privateKey).trim().replace("\n", "\\n"); }    }### Answer:
@Test public void testTrimAndReplace() { String rawPrivateKey = "BEGIN\nline1\nline2\nlastline"; String result = underTest.trimAndReplacePrivateKey(rawPrivateKey.toCharArray()); assertEquals("BEGIN\\nline1\\nline2\\nlastline", result); }