@Override
    public void removeSensor(final Sensor sensor) {
        Objects.requireNonNull(sensor, "Sensor is null");
        metrics.removeSensor(sensor.name());

        final Sensor parent = parentSensors.remove(sensor);
        if (parent != null) {
            metrics.removeSensor(parent.name());
        }
    }
@Test
    public void testRemoveNullSensor() {
        assertThrows(NullPointerException.class, () -> streamsMetrics.removeSensor(null));
    }