@Test
public void testOneFilter() {

    MetricFilter filter2 = new MetricFilter() {
        @Override
        public boolean matches(MetricName name, Metric metric) {
            return name.getKey().equals("test");
        }
    };
    CompositeMetricFilter filter = new CompositeMetricFilter(MetricFilter.ALL, filter2);
    Assert.assertArrayEquals(new MetricFilter[]{filter2}, filter.filters);
    MetricName name = MetricName.build("test");
    Assert.assertTrue(filter.matches(name, MetricManager.getCounter("ttt", name)));
    MetricName name2 = MetricName.build("test2");
    Assert.assertFalse(filter.matches(name2, MetricManager.getCounter("ttt", name2)));
}