static int delta(boolean prev, boolean next) {
        if (prev) {
            return next ? 0 : -1;
        } else {
            return next ? 1 : 0;
        }
    }
@Test
    public void testDelta() {
        assertEquals(0, ControllerMetricsChanges.delta(false, false));
        assertEquals(1, ControllerMetricsChanges.delta(false, true));
        assertEquals(-1, ControllerMetricsChanges.delta(true, false));
        assertEquals(0, ControllerMetricsChanges.delta(true, true));
    }