public JSONObject toJsonWithoutKey(Function<T, T> entrySerializer) {
    JSONArray entriesArray = new JSONArray();
    entries.forEach(entry -> entriesArray.put(entrySerializer.apply(entry)));
    return new JSONObject().put(ENTRIES_KEY, entriesArray).putOpt(NEXT_PAGE_TOKEN_KEY, nextPageToken);
  }
@param entrySerializer a function that serializes an entry in the page into JSON without key info in entries.
@return the {@link JSONObject} representing the page.
ambry-api/src/main/java/com/github/ambry/frontend/Page.java