code: public JsonToken peek() throws IOException {
          if (token != null) {
              return token;
          }
  
          switch (peekStack()) {
              case EMPTY_DOCUMENT:
                  replaceTop(JsonScope.NONEMPTY_DOCUMENT);
                  JsonToken firstToken = nextValue();
                  if (!lenient && token != JsonToken.BEGIN_ARRAY && token != JsonToken.BEGIN_OBJECT) {
                      throw new IOException(
                              "Expected JSON document to start with '[' or '{' but was " + token);
                  }
                  return firstToken;
              case EMPTY_ARRAY:
                  return nextInArray(true);
              case NONEMPTY_ARRAY:
                  return nextInArray(false);
              case EMPTY_OBJECT:
                  return nextInObject(true);
              case DANGLING_NAME:
                  return objectValue();
              case NONEMPTY_OBJECT:
                  return nextInObject(false);
              case NONEMPTY_DOCUMENT:
                  try {
                      JsonToken token = nextValue();
                      if (lenient) {
                          return token;
                      }
                      throw syntaxError("Expected EOF");
                  } catch (EOFException e) {
                      return token = JsonToken.END_DOCUMENT; // TODO: avoid throwing here?
                  }
              case CLOSED:
                  throw new IllegalStateException("JsonReader is closed");
              default:
                  throw new AssertionError();
          }
      }
docs: Returns the type of the next token without consuming it.