@Test
public void testMetricNamePrefixMatch() {

    Set<String> names = new HashSet<String>();
    names.add("shared.carts.my_cart");
    MetricNameSetFilter filter = new MetricNameSetFilter(names);
    MetricName mn = MetricName.build("shared.carts.my_cart.m1");
    Assert.assertTrue(filter.matches(mn, null));
    Set<String> names2 = new HashSet<String>();
    names2.add("shared.carts.my_cart.m15");
    MetricNameSetFilter filter2 = new MetricNameSetFilter(names2);
    MetricName mn2 = MetricName.build("shared.carts.my_cart.m1");
    Assert.assertFalse(filter2.matches(mn2, null));
}