@Test
  public void testCachedValueRetrievalDoesNotRequest() throws Exception {
    m_service.startAsync();
    m_service.awaitRunning(METRICS_SERVICE_TIMEOUT, TimeUnit.SECONDS);

    JMXMetricHolder jmxMetricHolder = m_service.getCachedJMXMetric(JMX_URL);
    Assert.assertNull(jmxMetricHolder);

    Map<String, String> restMetrics = m_service.getCachedRESTMetric(REST_URL);
    Assert.assertNull(restMetrics);
  }
Tests that initial missing values are returned correctly as {@code null}.
ambari-server/src/test/java/org/apache/ambari/server/state/services/MetricsRetrievalServiceTest.java