VarsMap extends HashMap<String, Object> { @Deprecated public String replaceVars(String expr) { return replaceVars(false, expr); } VarsMap(); @Deprecated String replaceVars(String expr); String replaceVars(boolean isScript, String expr); @Deprecated String[] replaceVarsForArray(String[] exprs);  }
@Test public void test() { VarsMap varsMap = new VarsMap(); varsMap.put("abc", "ABC"); varsMap.put("def", "ABC\nXYZ"); assertThat(varsMap.replaceVars(true, "***${abc}+++${def}---"), is("***\"ABC\"+++\"ABC\\nXYZ\"---")); assertThat(varsMap.replaceVars(false, "***${abc}+++${def}---"), is("***ABC+++ABC\nXYZ---")); }