@Test
  public void testClearAllSessions() {
    // Arrange
    reset();

    AtomicBoolean compactionEnabledForNode1 = new AtomicBoolean(false);
    AtomicBoolean compactionEnabledForNode2 = new AtomicBoolean(false);

    BootstrapSessionManager testBootstrapSessionManager = new BootstrapSessionManager(diskManagerConfig, (partitionId1, enable) -> {
      if (enable) {
        if (compactionEnabledForNode1.get()) {
          compactionEnabledForNode2.set(true);
        } else {
          compactionEnabledForNode1.set(true);
        }
      }
      return true;
    });
    testBootstrapSessionManager.enable();

    testBootstrapSessionManager.addAndStartBootstrapSession(mockPartitionId, "snap1", "nodeX");
    testBootstrapSessionManager.addAndStartBootstrapSession(mockPartitionId, "snap2", "nodeY");

    // Act
    testBootstrapSessionManager.clearAllSessions();

    // Assert
    assertNull(testBootstrapSessionManager.getBootstrapSession(mockPartitionId, "nodeX"));
    assertNull(testBootstrapSessionManager.getBootstrapSession(mockPartitionId, "nodeY"));
    assertTrue("Compaction should be re-enabled after session removal", compactionEnabledForNode1.get());
    assertTrue("Compaction should be re-enabled after session removal", compactionEnabledForNode2.get());
  }
Clears all sessions and checks that the sessions are removed correctly.
ambry-store/src/test/java/com/github/ambry/store/BootstrapSessionManagerTest.java