static public String jsonEscapeString(String input) {
        int length = input.length();
        int lenthWithLeeway = (int) (length * 1.1);

        StringBuilder sb = new StringBuilder(lenthWithLeeway);
        for (int i = 0; i < length; i++) {
            final char c = input.charAt(i);
            String escaped = getObligatoryEscapeCode(c);
            if (escaped == null)
                sb.append(c);
            else {
                sb.append(escaped);
            }
        }

        return sb.toString();
    }
@Test
    public void testEscapingLF() {
        String input = "{\nhello: \"wo\nrld\"}";
        System.out.println(input);
        assertEquals("{\\nhello: "+'\\'+'"'+"wo\\nrld\\\"}", JsonEscapeUtil.jsonEscapeString(input));
    }