void setPersistentIndex(StoreException exception) throws StoreException {
      PersistentIndex mockPersistentIndex = mock(PersistentIndex.class);
      index = mockPersistentIndex;
      doThrow(exception).when(mockPersistentIndex).findEntriesSince(any(FindToken.class), anyLong());
      doThrow(exception).when(mockPersistentIndex).findMissingKeys(anyList());
    }
Replace initial index in store with mock index which would throw specified exception when finding entries/keys.
@param exception the store exception to throw when finding entries or missing keys.
@throws StoreException
ambry-store/src/test/java/com/github/ambry/store/BlobStoreTest.java