Utils { public static String convertWindowsPath(String path) { String windowsPath = path; windowsPath = windowsPath.replace("\\", "/"); windowsPath = windowsPath.replaceAll("\\\\", "/"); return windowsPath; }  static InputStream getInputStream(final String resource); static String getFilesFolder(); static File getBaseImagesDirectory(); static File getImagesSubdirectory(final String subdirectoryName); static String convertWindowsPath(String path); static boolean isWindows(); static void logSystemProperties();  }
@Test void shouldConvertWindowsPath() { Map<String, String> answers = Map.of( "/this/is/already/a/path", "/this/is/already/a/path", "a\\windows\\path", "a/windows/path" ); for (Map.Entry<String, String> entry : answers.entrySet()) { assertEquals(entry.getValue(), Utils.convertWindowsPath(entry.getKey())); } }