code: private static void mapToWriter(Map<?, ?> map, JsonWriter writer) throws IOException {
      writer.beginObject();
      for (Map.Entry<?, ?> entry : map.entrySet()) {
        writer.name(String.valueOf(entry.getKey()));
        writeValue(entry.getValue(), writer);
      }
      writer.endObject();
    }
docs: Encode the given {@link Map} into the {@link JsonWriter}.