code: @Override
    public JsonElement serialize(Instant src, Type typeOfSrc, JsonSerializationContext context)
    {
      return new JsonPrimitive(fmt.print(src));
    }
docs: Gson invokes this call-back method during serialization when it encounters a field of the
  specified type. <p>
  
  In the implementation of this call-back method, you should consider invoking
  {@link JsonSerializationContext#serialize(Object, Type)} method to create JsonElements for any
  non-trivial field of the {@code src} object. However, you should never invoke it on the
  {@code src} object itself since that will cause an infinite loop (Gson will call your
  call-back method again).
  @param src the object that needs to be converted to Json.
  @param typeOfSrc the actual type (fully genericized version) of the source object.
  @return a JsonElement corresponding to the specified object.