public static <T> Page<T> fromJson(JSONObject jsonObject, Function<JSONObject, T> entryDeserializer) {
    JSONArray entriesArray = jsonObject.optJSONArray(ENTRIES_KEY);
    List<T> entries = entriesArray == null ? Collections.emptyList()
        : Utils.listView(entriesArray::length, i -> entryDeserializer.apply(entriesArray.getJSONObject(i)));
    String nextPageToken = jsonObject.optString(NEXT_PAGE_TOKEN_KEY, null);
    return new Page<>(entries, nextPageToken);
  }
@param jsonObject the {@link JSONObject} representing the page.
@param entryDeserializer a function that deserializes JSON for entries in the page.
@return the {@link Page} that was deserialized.
ambry-api/src/main/java/com/github/ambry/frontend/Page.java