public void updateQuarantineState(PartitionState newPartitionState,
      PartitionState oldPartitionState, long clusterAvgLatency)
  {
    long quarantineLatency = Math.max((long) (clusterAvgLatency * _relativeLatencyLowThresholdFactor),
        MIN_QUARANTINE_LATENCY_MS);
    quarantineLatency = Math.min(MAX_QUARANTINE_LATENCY_MS, quarantineLatency);

    long currentTime = _clock.currentTimeMillis();
    // Step 0: Pre-check if quarantine method works for clients, if it works, we will mark _quarantineEnabled as true
    preCheckQuarantine(newPartitionState, quarantineLatency);
    // Step 1: check if quarantine state still applies. If not, remove it from the quarantine map
    checkAndRemoveQuarantine(newPartitionState);
    // Step 2: Handle special clients recovery logic from the recovery map
    handleClientsRecovery(newPartitionState);
    // Step 3: Enroll new quarantine and recovery map
    enrollNewQuarantineAndRecovery(newPartitionState, oldPartitionState, quarantineLatency, currentTime);
  }
@Test
  public void testQuarantineNotEnabledInConfig()
  {
    setup(RelativeLoadBalancerStrategyFactory.DEFAULT_QUARANTINE_MAX_PERCENT, false, false);

    PartitionState state = new PartitionStateTestDataBuilder()
        .setTrackerClientStateMap(TrackerClientMockHelper.mockTrackerClients(2),
            Arrays.asList(StateUpdater.MIN_HEALTH_SCORE, 0.6),
            Arrays.asList(TrackerClientState.HealthState.UNHEALTHY, TrackerClientState.HealthState.UNHEALTHY),
            Arrays.asList(20, 20))
        .build();

    _quarantineManager.updateQuarantineState(state, state, DEFAULT_AVG_CLUSTER_LATENCY);

    Mockito.verifyZeroInteractions(_executorService);
    assertTrue(state.getQuarantineMap().isEmpty(), "Quarantine should not be enabled.");
  }