private void testGetLogSegmentsNotInJournal(int maxLogSegmentsToBeIgnored, int maxEntriesInJournal)
      throws StoreException {
    // fill current log segment to its capacity
    fillLastLogSegmentToCapacity(1, false);

    // test every log segment except the last one is returned
    fillLastLogSegmentToCapacity(maxEntriesInJournal, true);
    assertEquals("LogSegments mismatch ", getExpectedLogSegmentNames(1), state.index.getLogSegmentsNotInJournal());

    // create maxLogSegmentsToBeIgnored
    int logSegmentCount = maxLogSegmentsToBeIgnored;
    if (maxEntriesInJournal % maxLogSegmentsToBeIgnored > 0) {
      logSegmentCount--;
    }
    for (int i = 0; i < logSegmentCount; i++) {
      fillLastLogSegmentToCapacity(maxEntriesInJournal / maxLogSegmentsToBeIgnored, true);
    }
    if (maxEntriesInJournal % maxLogSegmentsToBeIgnored > 0) {
      fillLastLogSegmentToCapacity(
          maxEntriesInJournal - (logSegmentCount * (maxEntriesInJournal / maxLogSegmentsToBeIgnored)), true);
    }
    // every log segment except the last "maxLogSegmentsToBeIgnored" number of log segments should be returned
    assertEquals("LogSegments mismatch ", getExpectedLogSegmentNames(maxLogSegmentsToBeIgnored),
        state.index.getLogSegmentsNotInJournal());

    // reload and verify every log segment except the last one should be returned
    state.reloadIndex(true, false);
    assertEquals("LogSegments mismatch ", getExpectedLogSegmentNames(1), state.index.getLogSegmentsNotInJournal());
  }
Tests {@link PersistentIndex#getLogSegmentsNotInJournal()}
@param maxLogSegmentsToBeIgnored number of log segments not to be returned via {@link PersistentIndex#getLogSegmentsNotInJournal()}
@param maxEntriesInJournal max number of entries in {@link Journal}
@throws StoreException
ambry-store/src/test/java/com/github/ambry/store/IndexTest.java