### Question:
RegexUtil { static String substBackslashes(String string) { if (string == null) { return null; } Matcher matcher = BACKSLASH.matcher(string); return matcher.find() ? matcher.replaceAll("\\/") : string; } private  RegexUtil();   }### Answer:
@Test public void testSubstBackslashes() { assertTrue(RegexUtil.BACKSLASH.matcher("\\").find()); assertTrue(RegexUtil.BACKSLASH.matcher("abc\\").find()); assertNull(RegexUtil.substBackslashes(null)); assertEquals("abc", RegexUtil.substBackslashes("abc")); assertEquals("ab/c", RegexUtil.substBackslashes("ab/c")); assertEquals("ab/c", RegexUtil.substBackslashes("ab\\c")); assertEquals("ab assertEquals("ab assertEquals("/ab/c", RegexUtil.substBackslashes("\\ab\\c")); }