public void removeJobMetricsGroup(JobID jobId) {
        if (jobId != null) {
            TaskManagerJobMetricGroup groupToClose;
            synchronized (this) { // synchronization isn't strictly necessary as of FLINK-24864
                groupToClose = jobs.remove(jobId);
            }
            if (groupToClose != null) {
                groupToClose.close();
            }
        }
    }
@Test
    void testRemoveNullJobID() {
        metricGroup.removeJobMetricsGroup(null);
    }