### Question:
PmdSensor implements Sensor { @Override public void describe(SensorDescriptor descriptor) { descriptor.onlyOnLanguage(PmdConstants.LANGUAGE_KEY) .name("PmdSensor"); } PmdSensor(RulesProfile profile, PmdExecutor executor, PmdViolationRecorder pmdViolationRecorder, FileSystem fs); @Override String toString(); @Override void describe(SensorDescriptor descriptor); @Override void execute(SensorContext context);  }### Answer:
@Test void whenDescribeCalledThenSensorDescriptionIsWritten() { final SensorDescriptor mockDescriptor = mock(SensorDescriptor.class); when(mockDescriptor.onlyOnLanguage(anyString())).thenReturn(mockDescriptor); pmdSensor.describe(mockDescriptor); verify(mockDescriptor).onlyOnLanguage(PmdConstants.LANGUAGE_KEY); verify(mockDescriptor).name("PmdSensor"); }