JsonUtil { static String sanitize(char orig) { return sanitize(String.valueOf(orig)); }  static void startHash(Writer writer); static void endHash(Writer writer); static void startArray(Writer writer); static void endArray(Writer writer); static void addSeparator(Writer writer); static void putKey(Writer writer, String key); static void put(Writer writer, Object value); static void put(Writer writer, String value); static void putStringList(Writer writer, List<String> values); static void put(Writer writer, char value); static void put(Writer writer, Character value); static void putCharacterList(Writer writer, List<Character> values); static void put(Writer writer, byte value); static void put(Writer writer, Byte value); static void putByteList(Writer writer, List<Byte> values); static void put(Writer writer, short value); static void put(Writer writer, Short value); static void putShortList(Writer writer, List<Short> values); static void put(Writer writer, int value); static void put(Writer writer, Integer value); static void putIntegerList(Writer writer, List<Integer> values); static void put(Writer writer, long value); static void put(Writer writer, Long value); static void putLongList(Writer writer, List<Long> values); static void put(Writer writer, float value); static void put(Writer writer, Float value); static void putFloatList(Writer writer, List<Float> values); static void put(Writer writer, double value); static void put(Writer writer, Double value); static void putDoubleList(Writer writer, List<Double> values); static void put(Writer writer, boolean value); static void put(Writer writer, Boolean value); static void putBooleanList(Writer writer, List<Boolean> values); static void put(Writer writer, Date value); static void put(Writer writer, Enum<?> value); static void putEnumList(Writer writer, List<? extends Enum<?>> values); static void putDateList(Writer writer, List<Date> values);  }
@Test public void sanitize() { assertThat(JsonUtil.sanitize(null), is(nullValue())); assertThat(JsonUtil.sanitize("\\ \" / \b \f \n \r \t"), is("\\\\ \\\" \\/ \\b \\f \\n \\r \\t")); }