### Question:
JsonGeneratorImpl implements JsonGenerator, JsonChars, Serializable { @Override public JsonGenerator writeStartArray() { prepareValue(); writeIndent(); state.push(GeneratorState.START_ARRAY); justWrite(START_ARRAY_CHAR); depth++; writeEol(); return this; } JsonGeneratorImpl(final Writer writer, final BufferStrategy.BufferProvider<char[]> bufferProvider,
                      final boolean prettyPrint);   JsonGeneratorImpl(final OutputStream out, final BufferStrategy.BufferProvider<char[]> bufferProvider,
                      final boolean prettyPrint);   JsonGeneratorImpl(final OutputStream out, final Charset encoding, final BufferStrategy.BufferProvider<char[]> bufferProvider,
                      final boolean prettyPrint); @Override JsonGenerator writeStartObject(); @Override JsonGenerator writeStartObject(final String name); @Override JsonGenerator writeStartArray(); @Override JsonGenerator writeStartArray(final String name); @Override JsonGenerator write(final String name, final JsonValue value); @Override JsonGenerator write(final String name, final String value); @Override JsonGenerator write(final String name, final BigInteger value); @Override JsonGenerator write(final String name, final BigDecimal value); @Override JsonGenerator write(final String name, final int value); @Override JsonGenerator write(final String name, final long value); @Override JsonGenerator write(final String name, final double value); @Override JsonGenerator write(final String name, final boolean value); @Override JsonGenerator writeNull(final String name); @Override JsonGenerator writeEnd(); @Override JsonGenerator write(final JsonValue value); @Override JsonGenerator write(final String value); @Override JsonGenerator write(final BigDecimal value); @Override JsonGenerator write(final BigInteger value); @Override JsonGenerator write(final int value); @Override JsonGenerator write(final long value); @Override JsonGenerator write(final double value); @Override JsonGenerator write(final boolean value); @Override JsonGenerator writeNull(); @Override JsonGenerator writeKey(final String key); @Override void close(); @Override void flush();  }### Answer:
@Test(expected=JsonGenerationException.class) public void fail1() { final ByteArrayOutputStream baos = new ByteArrayOutputStream(); Json.createGenerator(baos) .writeStartArray("test"); }