docs: public String toJson() {
          StringWriter stringWriter = new StringWriter();
          JsonWriter jsonWriter = Json.createWriter(new PrintWriter(stringWriter));
          jsonWriter.writeObject(toJsonObject());
          jsonWriter.close();
          return stringWriter.toString();
      }