title: How to serialize an Object to Map by Moshi
body: <p>I want to serialize an Object to Map by Moshi.Here is my codes by Gson</p>
  
  <pre><code>    public static Map&lt;String, String&gt; toMap(Object obj, Gson gson) {
      if (gson == null) {
          gson = new Gson();
      }
      String json = gson.toJson(obj);
      Map&lt;String, String&gt; map = gson.fromJson(json, new TypeToken&lt;Map&lt;String, String&gt;&gt;() {
      }.getType());
      return map;
  }
  </code></pre>
  
  <p>And how to write by Moshi ?</p>