private void disableBackgroundThreads() {
    metricSinkMockedStatic = Mockito.mockStatic(MetricSink.class);
    metricSinkMockedStatic.when(MetricSink::getInstance).thenReturn(metricSinkInstance);
  }
Unit Test class for In Memory Replication Metric Collection.
ql/src/test/org/apache/hadoop/hive/ql/parse/repl/metric/TestReplicationMetricCollector.java