docs: synchronized void checkThreshold() {
      Ratio successRatio = circuit.getSuccessThreshold();
      Ratio failureRatio = circuit.getFailureThreshold();
  
      if (successRatio != null) {
        if (bitSet.occupiedBits() == successRatio.getDenominator() || (successRatio.getValue() == 1.0
            && bitSet.positiveRatioValue() < 1.0))
          if (bitSet.positiveRatioValue() >= successRatio.getValue())
            circuit.close();
          else
            circuit.open();
      } else if (failureRatio != null) {
        if (bitSet.occupiedBits() == failureRatio.getDenominator() || (failureRatio.getValue() == 1.0
            && bitSet.negativeRatioValue() < 1.0))
          if (bitSet.negativeRatioValue() >= failureRatio.getValue())
            circuit.open();
          else
            circuit.close();
      } else {
        if (bitSet.positiveRatioValue() == 1)
          circuit.close();
        else
          circuit.open();
      }
    }