public static <T extends ResponseBody> T toBean(String json, MessageHeaders<?, T, ?> messageHeaders) {
        final JavaType responseType;

        final Collection<Class<?>> typeParameters = messageHeaders.getResponseTypeParameters();

        if (typeParameters.isEmpty()) {
            responseType = objectMapper.constructType(messageHeaders.getResponseClass());
        } else {
            responseType = objectMapper
                    .getTypeFactory()
                    .constructParametricType(
                            messageHeaders.getResponseClass(),
                            typeParameters.toArray(new Class<?>[typeParameters.size()]));
        }
        try {
            JsonParser jsonParser = objectMapper.treeAsTokens(objectMapper.readTree(json));
            JavaType javaType = objectMapper.constructType(responseType);
            return objectMapper.readValue(jsonParser, javaType);
        } catch (Exception e) {
            throw new RuntimeException("json to flink bean exception.", e);
        }
    }
@Test
    public void toBeanTest() {
        // If successful, the validation is successful
        FlinkJsonUtil.toBean(
                "{\"jobs\":[{\"jid\":\"495c4e271dc64a4b7e78b8b1eb8d75f5\",\"name\":\"datagen\",\"state\":\"RUNNING\",\"start-time\":1703649915151,\"end-time\":-1,\"duration\":78437474,\"last-modification\":1703649915340,\"tasks\":{\"total\":6,\"created\":0,\"scheduled\":0,\"deploying\":0,\"running\":6,\"finished\":0,\"canceling\":0,\"canceled\":0,\"failed\":0,\"reconciling\":0,\"initializing\":0}},{\"jid\":\"214bbbe27dec4272f18fc3f14e9522b6\",\"name\":\"datagen-1\",\"state\":\"RUNNING\",\"start-time\":1703654026497,\"end-time\":-1,\"duration\":74326128,\"last-modification\":1703654026613,\"tasks\":{\"total\":2,\"created\":0,\"scheduled\":0,\"deploying\":0,\"running\":2,\"finished\":0,\"canceling\":0,\"canceled\":0,\"failed\":0,\"reconciling\":0,\"initializing\":0}}]}",
                JobsOverviewHeaders.getInstance());
    }