public String toJsonString() {
        ObjectMapper objectMapper = new ObjectMapper();
        try {
            return objectMapper.writeValueAsString(this);
        } catch (JsonProcessingException e) {
            throw new RuntimeException(e);
        }
    }
@Test
    void toJsonString() throws JsonProcessingException {
        ObjectMapper objectMapper = new ObjectMapper();
        Instance instance = Instance.getInstance();
        Map<String,Object> map = new HashMap<>();
        Map<String,Object> mmap = new HashMap<>();
        mmap.put("k","v");
        map.put("k",mmap);
        instance.setMetadata(map);
        instance.setControl(new Node.Endpoint("1.1.1.1",888));
        instance.setTransaction(new Node.Endpoint("2.2.2.2",999));
        System.out.println(instance.toJsonString());
        assertEquals(instance.toJsonString(),objectMapper.writeValueAsString(instance));
    }