WindowsPathEscaper { public String escapePath(String path) { String esc; if (path.indexOf(":") == 1) { esc = path.replaceFirst(":", "").replace('\\', '/'); esc = Character.toLowerCase(esc.charAt(0)) + esc.substring(1); } else { esc = path.replace('\\', '/'); } if (!esc.startsWith("/")) { esc = "/" + esc; } return esc; } WindowsPathEscaper(); static String escapePathStatic(String path); String escapePath(String path);  }
@Test(dataProvider = "pathProvider") public void shouldNonStaticallyEscapePathForWindowsHost(String windowsPath, String expectedPath) { WindowsPathEscaper windowsPathEscaper = new WindowsPathEscaper(); assertEquals(windowsPathEscaper.escapePath(windowsPath), expectedPath); }