static <E> DecodeJson<Optional<E>> decodeOptional(DecodeJson<E> decodeJson) {
        return node -> {
            if (node.isNull()) return Optional.empty();
            return Optional.of(decodeJson.decode(node));
        };
    }
Decode the JSON node provided into an instance of `T`.

@throws JsonMappingException if `node` cannot be decoded into `T`.
server-common/src/main/java/org/apache/kafka/server/util/json/DecodeJson.java