code: public static String serializeMergeFields(Map<String, FieldType> mergeFields) throws HelloSignException {
          if (mergeFields == null || mergeFields.isEmpty()) {
              return null;
          }
          JSONArray mergeFieldArray = new JSONArray();
          for (String key : mergeFields.keySet()) {
              FieldType type = mergeFields.get(key);
              JSONObject mergeFieldObj = new JSONObject();
              try {
                  mergeFieldObj.put("name", key);
                  mergeFieldObj.put("type", type.toString());
              } catch (JSONException e) {
                  throw new HelloSignException(e);
              }
              mergeFieldArray.put(mergeFieldObj);
          }
          return mergeFieldArray.toString();
      }
docs: Helper method to convert a Java Map into the JSON string required
  by the HelloSign API.
  @param mergeFields Map
  @return String
  @throws HelloSignException Thrown if there's a problem parsing JSONObjects