private void refreshState(boolean hardDeleteEnabled, boolean initState, boolean enableAutoCloseLastLogSegment)
      throws Exception {
    if (state != null) {
      state.destroy();
    }
    state = new CuratedLogIndexState(true, tempDir, hardDeleteEnabled, initState, true, withUndelete, false,
        enableAutoCloseLastLogSegment);
  }
Refreshes the state by destroying any existing state and creating a new one.
@param hardDeleteEnabled {@code true} if hard delete needs to be enabled. {@code false} otherwise.
@param initState {@code true} if some test state has to be created. {@code false} otherwise.
@param enableAutoCloseLastLogSegment
@throws Exception
ambry-store/src/test/java/com/github/ambry/store/BlobStoreCompactorTest.java