@VisibleForTesting
    static void instantiateHeapMemoryMetrics(final MetricGroup metricGroup) {
        instantiateMemoryUsageMetrics(
                metricGroup, () -> ManagementFactory.getMemoryMXBean().getHeapMemoryUsage());
    }
@Test
    void testHeapMetricsCompleteness() {
        final InterceptingOperatorMetricGroup heapMetrics = new InterceptingOperatorMetricGroup();

        MetricUtils.instantiateHeapMemoryMetrics(heapMetrics);

        assertThat(heapMetrics.get(MetricNames.MEMORY_USED)).isNotNull();
        assertThat(heapMetrics.get(MetricNames.MEMORY_COMMITTED)).isNotNull();
        assertThat(heapMetrics.get(MetricNames.MEMORY_MAX)).isNotNull();
    }