### Question:
JsonAdapter { @CheckReturnValue public final JsonAdapter<T> lenient() { final JsonAdapter<T> delegate = this; return new JsonAdapter<T>() { @Override public @Nullable T fromJson(JsonReader reader) throws IOException { boolean lenient = reader.isLenient(); reader.setLenient(true); try { return delegate.fromJson(reader); } finally { reader.setLenient(lenient); } } @Override public void toJson(JsonWriter writer, @Nullable T value) throws IOException { boolean lenient = writer.isLenient(); writer.setLenient(true); try { delegate.toJson(writer, value); } finally { writer.setLenient(lenient); } } @Override boolean isLenient() { return true; } @Override public String toString() { return delegate + ".lenient()"; } }; }  @CheckReturnValue abstract @Nullable T fromJson(JsonReader reader); @CheckReturnValue final @Nullable T fromJson(BufferedSource source); @CheckReturnValue final @Nullable T fromJson(String string); abstract void toJson(JsonWriter writer, @Nullable T value); final void toJson(BufferedSink sink, @Nullable T value); @CheckReturnValue final String toJson(@Nullable T value); @CheckReturnValue final @Nullable Object toJsonValue(@Nullable T value); @CheckReturnValue final @Nullable T fromJsonValue(@Nullable Object value); @CheckReturnValue final JsonAdapter<T> serializeNulls(); @CheckReturnValue final JsonAdapter<T> nullSafe(); @CheckReturnValue final JsonAdapter<T> nonNull(); @CheckReturnValue final JsonAdapter<T> lenient(); @CheckReturnValue final JsonAdapter<T> failOnUnknown(); @CheckReturnValue JsonAdapter<T> indent(final String indent);  }### Answer:
@Test public void lenient() throws Exception { JsonAdapter<Double> lenient = new JsonAdapter<Double>() { @Override public Double fromJson(JsonReader reader) throws IOException { return reader.nextDouble(); } @Override public void toJson(JsonWriter writer, Double value) throws IOException { writer.value(value); } }.lenient(); JsonReader reader = factory.newReader("[-Infinity, NaN, Infinity]"); reader.beginArray(); assertThat(lenient.fromJson(reader)).isEqualTo(Double.NEGATIVE_INFINITY); assertThat(lenient.fromJson(reader)).isNaN(); assertThat(lenient.fromJson(reader)).isEqualTo(Double.POSITIVE_INFINITY); reader.endArray(); JsonWriter writer = factory.newWriter(); writer.beginArray(); lenient.toJson(writer, Double.NEGATIVE_INFINITY); lenient.toJson(writer, Double.NaN); lenient.toJson(writer, Double.POSITIVE_INFINITY); writer.endArray(); assertThat(factory.json()).isEqualTo("[-Infinity,NaN,Infinity]"); }