code: public Map<String, Object> toJson() {
      Map<String, Object> json = new HashMap<>();
      json.put("browserTimeout", browserTimeout);
      json.put("debug", debug);
      json.put("jettyMaxThreads", jettyMaxThreads);
      json.put("log", log);
      json.put("host", host);
      json.put("port", port);
      json.put("role", role);
      json.put("timeout", timeout);
  
      serializeFields(json);
  
      return json.entrySet().stream()
          .filter(entry -> entry.getValue() != null)
          .collect(toImmutableSortedMap(natural(), Map.Entry::getKey, Map.Entry::getValue));
    }
docs: Return a JsonElement representation of the configuration. Does not serialize nulls.