@Override
  public void encode(Object object, Type bodyType, RequestTemplate template)
      throws EncodeException {
    if (object == null)
      return;
    if (object instanceof JSONArray || object instanceof JSONObject) {
      template.body(object.toString());
    } else {
      throw new EncodeException(format("%s is not a type supported by this encoder.", bodyType));
    }
  }
@Test
  void encodesObject() {
    new JsonEncoder().encode(jsonObject, JSONObject.class, requestTemplate);
    JSONAssert.assertEquals("{\"a\":\"b\",\"c\":1}", new String(requestTemplate.body(), UTF_8),
        false);
  }