static int delta(boolean prev, boolean next) {
        if (prev) {
            return next ? 0 : -1;
        } else {
            return next ? 1 : 0;
        }
    }
Calculates the change between two boolean values, expressed as an integer.
metadata/src/main/java/org/apache/kafka/controller/metrics/ControllerMetricsChanges.java