JsonWriter { public void flush() throws JsonException { try { writer.flush(); } catch (IOException e) { throw new JsonException(e.getMessage(), e); } } JsonWriter(Writer writer);  JsonWriter(OutputStream out); final boolean isWriteNulls(); final void setWriteNulls(boolean writeNulls); void writeStartObject(); void writeEndObject(); void writeStartArray(); void writeEndArray(); void writeKey(String key); void writeString(String value); void writeValue(String value); void writeValue(long value); void writeValue(double value); void writeValue(boolean value); void writeNull(); void flush(); void close();  }
@Test public void flushesUnderlyingWriter() throws Exception { Writer writer = mock(Writer.class); jsonWriter = new JsonWriter(writer); jsonWriter.flush(); verify(writer).flush(); }