### Question:
Rfc3339DateJsonAdapter extends JsonAdapter<Date> { @Override public synchronized void toJson(JsonWriter writer, Date value) throws IOException { if (value == null) { writer.nullValue(); } else { String string = Iso8601Utils.format(value); writer.value(string); } }  @Override synchronized Date fromJson(JsonReader reader); @Override synchronized void toJson(JsonWriter writer, Date value);  }### Answer:
@Test public void toJson() throws Exception { assertThat(adapter.toJson(newDate(1970, 1, 1, 0, 0, 0, 0, 0))) .isEqualTo("\"1970-01-01T00:00:00.000Z\""); assertThat(adapter.toJson(newDate(1985, 4, 12, 23, 20, 50, 520, 0))) .isEqualTo("\"1985-04-12T23:20:50.520Z\""); assertThat(adapter.toJson(newDate(1996, 12, 19, 16, 39, 57, 0, -8 * 60))) .isEqualTo("\"1996-12-20T00:39:57.000Z\""); assertThat(adapter.toJson(newDate(1990, 12, 31, 23, 59, 59, 0, 0))) .isEqualTo("\"1990-12-31T23:59:59.000Z\""); assertThat(adapter.toJson(newDate(1990, 12, 31, 15, 59, 59, 0, -8 * 60))) .isEqualTo("\"1990-12-31T23:59:59.000Z\""); assertThat(adapter.toJson(newDate(1937, 1, 1, 12, 0, 27, 870, 20))) .isEqualTo("\"1937-01-01T11:40:27.870Z\""); }