private StoreFindToken getExpectedJournalEndToken(Offset tokenOffset, StoreKey lastKey) throws StoreException {
    IndexSegment segmentOfToken = state.index.getIndexSegments().floorEntry(tokenOffset).getValue();
    StoreFindToken expectedEndToken =
        new StoreFindToken(tokenOffset, state.sessionId, state.incarnationId, false, segmentOfToken.getResetKey(),
            segmentOfToken.getResetKeyType(), segmentOfToken.getResetKeyLifeVersion());
    // the last message's size will be the size of the most recent log entry for its key, not necessarily the entry at
    // tokenOffset. This size is used to calculate bytes read. even if it is not strictly the entry at the log offset
    // of the last journal entry processed.
    long lastMessageSize =
        state.getExpectedValue((MockId) lastKey, EnumSet.allOf(PersistentIndex.IndexEntryType.class), null).getSize();
    Offset endOffset = state.log.getFileSpanForMessage(tokenOffset, lastMessageSize).getEndOffset();
    expectedEndToken.setBytesRead(state.index.getAbsolutePositionInLogForOffset(endOffset));
    return expectedEndToken;
  }
Create a journal-based find token that can be compared against a token returned by
{@link PersistentIndex#findEntriesSince}.
@param tokenOffset the offset to include in the token
@param lastKey the {@link StoreKey} of the last message that will be returned in the query.
@return a {@link StoreFindToken} with bytes read set.
ambry-store/src/test/java/com/github/ambry/store/IndexTest.java