### Question:
JsonReaderImpl implements JsonReader { @Override public JsonObject readObject() { final JsonStructure read = read(); checkType(JsonObject.class, read); return JsonObject.class.cast(read); } JsonReaderImpl(final JsonParser parser, final BufferStrategy.BufferProvider<char[]> bufferProvider);  JsonReaderImpl(final JsonParser parser, boolean subStreamReader,
                          final BufferStrategy.BufferProvider<char[]> bufferProvider); @Override JsonStructure read(); @Override JsonValue readValue(); @Override JsonObject readObject(); @Override JsonArray readArray(); @Override void close();  }### Answer:
@Test(expected = JsonParsingException.class) public void badTypeObject() { Json.createReaderFactory(getFactoryConfig()).createReader(new StringReader("[]")).readObject(); }
@Test(expected = JsonReaderImpl.NothingToRead.class) public void emptyStream() { Json.createReaderFactory(emptyMap()) .createReader(new ByteArrayInputStream(new byte[0]), utf8Charset) .readObject(); }
@Test(expected = JsonParsingException.class) public void testInvalidNumber() { String jsonWithIllegalNumber = "{\"val\":12.34-2}"; JsonReaderImpl.class.cast(Json.createReader(new StringReader(jsonWithIllegalNumber))).readObject(); }