public static String toJson(final Object object) {
        try {
            return MAPPER.writeValueAsString(object);
        } catch (IOException e) {
            LOG.warn("write to json string error: " + object, e);
            return Constants.EMPTY_JSON;
        }
    }
@Test
    public void toJson() {
        List<String> testList = new LinkedList<>();
        Map<String, String> testMap = new HashMap<>();
        for (int i = 0; i < 10; i++) {
            testList.add("test_string_" + i);
            testMap.put("test_map_" + i, "test_value_" + i);
        }
        TestObject object = TestObject.builder()
                .id(123)
                .name("test object")
                .deleted(false)
                .testList(testList)
                .testMap(testMap)
                .nullObject(null)
                .emptyList(new LinkedList<>())
                .emptyMap(new HashMap<>())
                .nestedMap(new HashMap<>() {
                    {
                        put("map1", testMap);
                        put("map2", new HashMap<>());
                        put("boolean", false);
                        put("testInt", 100);
                        put("class", "nestedClass");
                    }
                })
                .build();
        JsonElement expectedJson = JsonParser.parseString(EXPECTED_JSON);
        JsonElement objectJson = JsonParser.parseString(JsonUtils.toJson(object));
        assertEquals(expectedJson, objectJson);

        Object o = new Object();
        assertEquals(Constants.EMPTY_JSON, JsonUtils.toJson(o));
    }