public void addMetricsRecorder(final RocksDBMetricsRecorder metricsRecorder) {
        final String metricsRecorderName = metricsRecorderName(metricsRecorder);
        if (metricsRecordersToTrigger.containsKey(metricsRecorderName)) {
            throw new IllegalStateException("RocksDB metrics recorder for store \"" + metricsRecorder.storeName() +
                "\" of task " + metricsRecorder.taskId().toString() + " has already been added. "
                + "This is a bug in Kafka Streams.");
        }
        metricsRecordersToTrigger.put(metricsRecorderName, metricsRecorder);
    }
@Test
    public void shouldThrowIfRecorderToAddHasBeenAlreadyAdded() {
        when(recorder1.storeName()).thenReturn(STORE_NAME1);
        when(recorder1.taskId()).thenReturn(TASK_ID1);
        
        recordingTrigger.addMetricsRecorder(recorder1);
        assertThrows(
            IllegalStateException.class,
            () -> recordingTrigger.addMetricsRecorder(recorder1)
        );
    }