public static String toJson(final Object obj, boolean prettyFormat) {
        return JSON.toJSONString(obj, prettyFormat);
    }
@Test
    public void testToJson_prettyString() {
        RemotingSerializable serializable = new RemotingSerializable() {
            private List<String> stringList = Arrays.asList("a", "o", "e", "i", "u", "v");

            public List<String> getStringList() {
                return stringList;
            }

            public void setStringList(List<String> stringList) {
                this.stringList = stringList;
            }
        };

        String prettyString = serializable.toJson(true);

        assertThat(prettyString).isEqualTo("{\n" +
            "\t\"stringList\":[\n" +
            "\t\t\"a\",\n" +
            "\t\t\"o\",\n" +
            "\t\t\"e\",\n" +
            "\t\t\"i\",\n" +
            "\t\t\"u\",\n" +
            "\t\t\"v\"\n" +
            "\t]\n" +
            "}");
    }