### Question:
StringEscapeUtil { public static String escapeInString(String text) { if (StringUtils.isBlank(text)) { return text; } StringBuilder builder = new StringBuilder(); int index = 0; while (index < text.length()) { char ch = text.charAt(index); if (ch == '\\') { if (contains(FEEL_ESCAPE_MAP.keySet(), text, index + 1)) { builder.append("\\"); builder.append(text.charAt(index + 1)); index += 2; } else if (contains(REGEXP_ESCAPE_MAP.keySet(), text, index + 1)) { builder.append("\\"); builder.append("\\"); builder.append(text.charAt(index + 1)); index = index + 2; } else if (isUnicodeEscape(text, index + 1)) { builder.append("\\"); for(int i = 0; i < 5; i++) { builder.append(text.charAt(index + 1 + i)); } index = index + 6; } else { builder.append('\\'); builder.append('\\'); index = index + 1; } } else if (ch == '"') { builder.append("\\\""); index++; } else { builder.append(ch); index++; } } return builder.toString(); }  static String stripQuotes(String value); static String unescapeFEEL(String lexeme); static String escapeFEEL(String value); static String escapeInString(String text);  }### Answer:
@Test public void testEscapeInString() { assertNull(StringEscapeUtil.escapeInString(null)); assertEquals("", StringEscapeUtil.escapeInString("")); assertEquals("abc", StringEscapeUtil.escapeInString("abc")); assertEquals("ab\\\"abc", StringEscapeUtil.escapeInString("ab\\\"abc")); assertEquals("ab\\\"abc", StringEscapeUtil.escapeInString("ab\"abc")); assertEquals("“£%$&3332", StringEscapeUtil.escapeInString("“£%$&3332")); assertEquals("ab\\\\dc", StringEscapeUtil.escapeInString("ab\\dc")); assertEquals("\u0009", StringEscapeUtil.escapeInString("\u0009")); assertEquals("\\u0009", StringEscapeUtil.escapeInString("\\u0009")); assertEquals("\uD83D\uDCA9", StringEscapeUtil.escapeInString("\uD83D\uDCA9")); assertEquals("\ud83d\udca9", StringEscapeUtil.escapeInString("\ud83d\udca9")); assertEquals("\ud83d\udc0e\uD83D\uDE00", StringEscapeUtil.escapeInString("\ud83d\udc0e\uD83D\uDE00")); assertEquals("🐎😀", StringEscapeUtil.escapeInString("🐎😀")); }