code: public static void write(Instance instance, Appendable a) {
          try {
              InstanceConverter c = new InstanceConverter();
              c.toJSON(instance).writeJSONString(a);
          } catch (IOException | JSONConverterException e) {
              throw new IllegalArgumentException(e);
          }
      }
docs: Write an instance
  
  @param instance the instance to write
  @param a        the stream to write on.
  @throws IllegalArgumentException if an error occurred while writing the json