@Nullable
    private JsonElement tryBeginNesting(JsonReader in, JsonToken peeked) throws IOException {
      switch (peeked) {
        case BEGIN_ARRAY:
          in.beginArray();
          return new JsonArray();
        case BEGIN_OBJECT:
          in.beginObject();
          return new JsonObject();
        default:
          return null;
      }
    }
Tries to begin reading a JSON array or JSON object, returning {@code null} if the next
element is neither of those.
java_src/src/main/java/com/google/crypto/tink/internal/JsonParser.java