public static Sensor totalCacheSizeBytesSensor(final String threadId,
                                                   final String taskId,
                                                   final StreamsMetricsImpl streamsMetrics) {
        final String name = CACHE_SIZE_BYTES_TOTAL;
        final Sensor sensor = streamsMetrics.taskLevelSensor(threadId, taskId, name, RecordingLevel.DEBUG);

        addValueMetricToSensor(
                sensor,
                TASK_LEVEL_GROUP,
                streamsMetrics.taskLevelTagMap(threadId, taskId),
                name,
                CACHE_SIZE_BYTES_TOTAL_DESCRIPTION
        );
        return sensor;
    }
@Test
    public void shouldGetTotalCacheSizeInBytesSensor() {
        final String operation = "cache-size-bytes-total";
        when(streamsMetrics.taskLevelSensor(THREAD_ID, TASK_ID, operation, RecordingLevel.DEBUG))
                .thenReturn(expectedSensor);
        final String totalBytesDescription = "The total size in bytes of this task's cache.";
        when(streamsMetrics.taskLevelTagMap(THREAD_ID, TASK_ID)).thenReturn(tagMap);

        try (final MockedStatic<StreamsMetricsImpl> streamsMetricsStaticMock = mockStatic(StreamsMetricsImpl.class)) {
            final Sensor sensor = TaskMetrics.totalCacheSizeBytesSensor(THREAD_ID, TASK_ID, streamsMetrics);
            streamsMetricsStaticMock.verify(
                    () -> StreamsMetricsImpl.addValueMetricToSensor(
                            expectedSensor,
                            TASK_LEVEL_GROUP,
                            tagMap,
                            operation,
                            totalBytesDescription
                    )
            );
            assertThat(sensor, is(expectedSensor));
        }
    }