### Question:
JsonReader implements Closeable { public final @Nullable Object readJsonValue() throws IOException { switch (peek()) { case BEGIN_ARRAY: List<Object> list = new ArrayList<>(); beginArray(); while (hasNext()) { list.add(readJsonValue()); } endArray(); return list; case BEGIN_OBJECT: Map<String, Object> map = new LinkedHashTreeMap<>(); beginObject(); while (hasNext()) { String name = nextName(); Object value = readJsonValue(); Object replaced = map.put(name, value); if (replaced != null) { throw new JsonDataException( "Map key '" + name + "' has multiple values at path " + getPath() + ": " + replaced + " and " + value); } } endObject(); return map; case STRING: return nextString(); case NUMBER: return nextDouble(); case BOOLEAN: return nextBoolean(); case NULL: return nextNull(); default: throw new IllegalStateException( "Expected a value but was " + peek() + " at path " + getPath()); } } JsonReader();   JsonReader(JsonReader copyFrom); @CheckReturnValue static JsonReader of(BufferedSource source); final void setLenient(boolean lenient); @CheckReturnValue final boolean isLenient(); final void setFailOnUnknown(boolean failOnUnknown); @CheckReturnValue final boolean failOnUnknown(); abstract void beginArray(); abstract void endArray(); abstract void beginObject(); abstract void endObject(); @CheckReturnValue abstract boolean hasNext(); @CheckReturnValue abstract Token peek(); @CheckReturnValue abstract String nextName(); @CheckReturnValue abstract int selectName(Options options); abstract void skipName(); abstract String nextString(); @CheckReturnValue abstract int selectString(Options options); abstract boolean nextBoolean(); abstract @Nullable T nextNull(); abstract double nextDouble(); abstract long nextLong(); abstract int nextInt(); abstract BufferedSource nextSource(); abstract void skipValue(); final @Nullable Object readJsonValue(); @CheckReturnValue abstract JsonReader peekJson(); @CheckReturnValue final String getPath(); @SuppressWarnings("unchecked") @CheckReturnValue final @Nullable T tag(Class<T> clazz); final void setTag(Class<T> clazz, T value); abstract void promoteNameToValue();  }### Answer:
@Test public void readJsonValueInt() throws IOException { JsonReader reader = newReader("1"); Object value = reader.readJsonValue(); assertThat(value).isEqualTo(1.0); }
@Test public void readJsonValueMap() throws IOException { JsonReader reader = newReader("{\"hello\": \"world\"}"); Object value = reader.readJsonValue(); assertThat(value).isEqualTo(Collections.singletonMap("hello", "world")); }
@Test public void readJsonValueList() throws IOException { JsonReader reader = newReader("[\"a\", \"b\"]"); Object value = reader.readJsonValue(); assertThat(value).isEqualTo(Arrays.asList("a", "b")); }
@Test public void readJsonValueListMultipleTypes() throws IOException { JsonReader reader = newReader("[\"a\", 5, false]"); Object value = reader.readJsonValue(); assertThat(value).isEqualTo(Arrays.asList("a", 5.0, false)); }
@Test public void readJsonValueNestedListInMap() throws IOException { JsonReader reader = newReader("{\"pizzas\": [\"cheese\", \"pepperoni\"]}"); Object value = reader.readJsonValue(); assertThat(value) .isEqualTo(Collections.singletonMap("pizzas", Arrays.asList("cheese", "pepperoni"))); }