### Question:
FilteringMetricsScope extends AccumulateByNameMetricsScope { @Override public void addData(String name, double value, StandardUnit unit) { addData(name, value, unit, MetricsLevel.DETAILED); } FilteringMetricsScope();  FilteringMetricsScope(MetricsLevel metricsLevel, Set<String> metricsEnabledDimensions); @Override void addData(String name, double value, StandardUnit unit); @Override void addData(String name, double value, StandardUnit unit, MetricsLevel level); @Override void addDimension(String name, String value);  }### Answer:
@Test public void testMetricsLevel() { TestScope scope = new TestScope(MetricsLevel.SUMMARY, null); scope.addData("summaryDataName", 2.0, StandardUnit.COUNT, MetricsLevel.SUMMARY); scope.addData("summaryDataName", 10.0, StandardUnit.COUNT, MetricsLevel.SUMMARY); scope.addData("detailedDataName", 4.0, StandardUnit.BYTES, MetricsLevel.DETAILED); scope.addData("noLevelDataName", 3.0, StandardUnit.MILLISECONDS); scope.assertMetrics(TestHelper.constructDatum("summaryDataName", StandardUnit.COUNT, 10.0, 2.0, 12.0, 2.0)); }
@Test public void testMetricsLevelNone() { TestScope scope = new TestScope(MetricsLevel.NONE, null); scope.addData("summaryDataName", 2.0, StandardUnit.COUNT, MetricsLevel.SUMMARY); scope.addData("summaryDataName", 10.0, StandardUnit.COUNT, MetricsLevel.SUMMARY); scope.addData("detailedDataName", 4.0, StandardUnit.BYTES, MetricsLevel.DETAILED); scope.addData("noLevelDataName", 3.0, StandardUnit.MILLISECONDS); scope.assertMetrics(); }