public static Frequencies forBooleanValues(MetricName falseMetricName, MetricName trueMetricName) {
        List<Frequency> frequencies = new ArrayList<>();
        if (falseMetricName != null) {
            frequencies.add(new Frequency(falseMetricName, 0.0));
        }
        if (trueMetricName != null) {
            frequencies.add(new Frequency(trueMetricName, 1.0));
        }
        if (frequencies.isEmpty()) {
            throw new IllegalArgumentException("Must specify at least one metric name");
        }
        Frequency[] frequencyArray = frequencies.toArray(new Frequency[0]);
        return new Frequencies(2, 0.0, 1.0, frequencyArray);
    }
Create a Frequencies instance with metrics for the frequency of a boolean sensor that records 0.0 for
false and 1.0 for true.

@param falseMetricName the name of the metric capturing the frequency of failures; may be null if not needed
@param trueMetricName  the name of the metric capturing the frequency of successes; may be null if not needed
@return the Frequencies instance; never null
@throws IllegalArgumentException if both {@code falseMetricName} and {@code trueMetricName} are null
clients/src/main/java/org/apache/kafka/common/metrics/stats/Frequencies.java