@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 encodesNull() {
    new JsonEncoder().encode(null, JSONObject.class, new RequestTemplate());
    assertThat(requestTemplate.body()).isNull();
  }