private boolean isCacheValid(String partitionId, CosmosChangeFeedFindToken cosmosChangeFeedFindToken,
      ChangeFeedCacheEntry changeFeedCacheEntry) {
    return Objects.equals(cosmosChangeFeedFindToken.getCacheSessionId(), changeFeedCacheEntry.getCacheSessionId())
        && Objects.equals(cosmosChangeFeedFindToken.getStartContinuationToken(),
        changeFeedCacheEntry.getStartContinuationToken()) && Objects.equals(
        cosmosChangeFeedFindToken.getEndContinuationToken(), changeFeedCacheEntry.getEndContinuationToken())
        && cosmosChangeFeedFindToken.getTotalItems() == changeFeedCacheEntry.getFetchedEntries().size()
        && Objects.equals(partitionId, changeFeedCacheEntry.getPartitionId());
  }
Check is the cache is valid for the {@code cosmosChangeFeedFindToken} provided.
@param partitionId partition of the {@code cosmosChangeFeedFindToken}.
@param cosmosChangeFeedFindToken {@link CosmosChangeFeedFindToken} object.
@return true is cache is valid. false otherwise.
ambry-cloud/src/main/java/com/github/ambry/cloud/azure/CosmosChangeFeedBasedReplicationFeed.java