### Question:
JsonWriter implements Closeable, Flushable { public abstract JsonWriter nullValue() throws IOException; JsonWriter(); @CheckReturnValue static JsonWriter of(BufferedSink sink); void setIndent(String indent); @CheckReturnValue final String getIndent(); final void setLenient(boolean lenient); @CheckReturnValue final boolean isLenient(); final void setSerializeNulls(boolean serializeNulls); @CheckReturnValue final boolean getSerializeNulls(); abstract JsonWriter beginArray(); abstract JsonWriter endArray(); abstract JsonWriter beginObject(); abstract JsonWriter endObject(); abstract JsonWriter name(String name); abstract JsonWriter value(@Nullable String value); abstract JsonWriter nullValue(); abstract JsonWriter value(boolean value); abstract JsonWriter value(@Nullable Boolean value); abstract JsonWriter value(double value); abstract JsonWriter value(long value); abstract JsonWriter value(@Nullable Number value); final JsonWriter value(BufferedSource source); @CheckReturnValue abstract BufferedSink valueSink(); final JsonWriter jsonValue(@Nullable Object value); final void promoteValueToName(); @CheckReturnValue final int beginFlatten(); final void endFlatten(int token); @CheckReturnValue final String getPath(); @SuppressWarnings("unchecked") @CheckReturnValue final @Nullable T tag(Class<T> clazz); final void setTag(Class<T> clazz, T value);  }### Answer:
@Test public void topLevelNull() throws IOException { JsonWriter writer = factory.newWriter(); writer.nullValue(); writer.close(); assertThat(factory.json()).isEqualTo("null"); }