### Question:
DefaultMetricsReader implements MetricsReader { private MetricValue readCpuUtilization() { int availableProcessors = operatingSystemMXBean.getAvailableProcessors(); long stUpTime = runtimeMXBean.getUptime(); long stProcessCpuTime = operatingSystemMXBean.getProcessCpuTime(); try { Thread.sleep(100); } catch (Exception ex) { } long edUpTime = runtimeMXBean.getUptime(); long edProcessCpuTime = operatingSystemMXBean.getProcessCpuTime(); long elapsedCpu = edProcessCpuTime - stProcessCpuTime; long elapsedTime = edUpTime - stUpTime; double cpuUsage = Math.min(100F, elapsedCpu / (elapsedTime * 10000F * availableProcessors)); return MetricValue.percent(cpuUsage); } DefaultMetricsReader(); @Override List<MetricName> readableNames(); @Override MetricValue readValue(MetricName name);  }### Answer:
@Test public void testReadCpuUtilization() { System.out.println("testReadCpuUtilization"); DefaultMetricsReader reader = new DefaultMetricsReader(); MetricValue value = reader.readValue(MetricName.CPU_UTILIZATION); assertThat(value, notNullValue()); assertThat(value.getUnit(), equalTo(MetricUnit.PERCENT)); assertThat(value.getValue(), greaterThanOrEqualTo(0.0)); assertThat(value.getValue(), lessThanOrEqualTo(100.0)); }