### Question:
JsonValueReader extends JsonReader { @Override public void close() throws IOException { Arrays.fill(stack, 0, stackSize, null); stack[0] = JSON_READER_CLOSED; scopes[0] = CLOSED; stackSize = 1; } JsonValueReader(Object root);   JsonValueReader(JsonValueReader copyFrom); @Override void beginArray(); @Override void endArray(); @Override void beginObject(); @Override void endObject(); @Override boolean hasNext(); @Override Token peek(); @Override String nextName(); @Override int selectName(Options options); @Override void skipName(); @Override String nextString(); @Override int selectString(Options options); @Override boolean nextBoolean(); @Override @Nullable T nextNull(); @Override double nextDouble(); @Override long nextLong(); @Override int nextInt(); @Override void skipValue(); @Override BufferedSource nextSource(); @Override JsonReader peekJson(); @Override void promoteNameToValue(); @Override void close();  }### Answer:
@Test public void close() throws Exception { try { JsonReader reader = new JsonValueReader(singletonList("a")); reader.beginArray(); reader.close(); reader.nextString(); fail(); } catch (IllegalStateException expected) { } try { JsonReader reader = new JsonValueReader(singletonList("a")); reader.close(); reader.beginArray(); fail(); } catch (IllegalStateException expected) { } }