Util { public static String envVarEscape(String str) { return str .replace("\\", "\\\\") .replace("\"", "\\\"") .replace("`", "\\`"); }  static String envVarEscape(String str); static String getSamzaVersion(); static String getTaskClassVersion(Config config); static InetAddress getLocalHost();  }
@Test public void testEnvVarEscape() { String noSpecialCharacters = "hello world 123 .?! '"; assertEquals(noSpecialCharacters, Util.envVarEscape(noSpecialCharacters)); String withSpecialCharacters = "quotation \" backslash \\ grave accent `"; String escaped = "quotation \\\" backslash \\\\ grave accent \\`"; assertEquals(escaped, Util.envVarEscape(withSpecialCharacters)); }