code: private static JsonNode toJson(AggregatedHttpMessage res, @Nullable JsonNodeType expectedNodeType) {
          final String content = toString(res);
          final JsonNode node;
          try {
              node = Jackson.readTree(content);
          } catch (JsonParseException e) {
              throw new CentralDogmaException("failed to parse the response JSON", e);
          }
  
          if (expectedNodeType != null && node.getNodeType() != expectedNodeType) {
              throw new CentralDogmaException(
                      "invalid server response; expected: " + expectedNodeType +
                      ", actual: " + node.getNodeType() + ", content: " + content);
          }
          return node;
      }
docs: Parses the content of the specified {@link AggregatedHttpMessage} into a {@link JsonNode}.