@Override
  public void close() {
    if (metrics != null) {
      metrics.removeSensor(errorSensor.name());
    }
    logger.close();
  }
@Test
  public void shouldRemoveSensorOnClose() {
	// When:
	meteredProcessingLogger.close();

	// Then:
	verify(metrics).removeSensor(sensorName);
	verify(processingLogger).close();
  }