@Override
    public boolean matches(String name, Metric metric) {
        return patterns.stream().anyMatch(pattern -> pattern.matcher(name).matches());
    }
@Test
    void test() {
        final List<MapperConfig> mapperConfigs = ImmutableList.of(
                new MapperConfig("foo.*.bar.*.baz", "test1", Collections.emptyMap()),
                new MapperConfig("hello.world", "test2", Collections.emptyMap())
        );

        final PrometheusMetricFilter filter = new PrometheusMetricFilter(mapperConfigs);
        final Metric metric = new Counter();

        assertThat(filter.matches("foo.123.bar.456.baz", metric)).isTrue();
        assertThat(filter.matches("foo.abc.bar.456.baz", metric)).isTrue();
        assertThat(filter.matches("foo.123.nope.bar.456.baz", metric)).isFalse();
        assertThat(filter.matches("nope.foo.123.bar.456.baz", metric)).isFalse();
        assertThat(filter.matches("foo.123.bar.456.baz.nope", metric)).isFalse();
        assertThat(filter.matches("hello.world", metric)).isTrue();
        assertThat(filter.matches("hello.123.world", metric)).isFalse();
    }