@Test public void matchesTest() { MetricNameRegexFilter metricNameRegexFilter1 = new MetricNameRegexFilter(".*"); Assert.assertTrue(metricNameRegexFilter1.matches("test1", mock(Metric.class))); Assert.assertTrue(metricNameRegexFilter1.matches("test2", mock(Metric.class))); Assert.assertTrue(metricNameRegexFilter1.matches("test3", mock(Metric.class))); MetricNameRegexFilter metricNameRegexFilter2 = new MetricNameRegexFilter("test1"); Assert.assertTrue(metricNameRegexFilter2.matches("test1", mock(Metric.class))); Assert.assertFalse(metricNameRegexFilter2.matches("test2", mock(Metric.class))); Assert.assertFalse(metricNameRegexFilter2.matches("test3", mock(Metric.class))); }
@Override public boolean matches(String name, Metric metric) { return this.matcher.reset(name).matches(); }
MetricNameRegexFilter implements MetricFilter { @Override public boolean matches(String name, Metric metric) { return this.matcher.reset(name).matches(); } }
MetricNameRegexFilter implements MetricFilter { @Override public boolean matches(String name, Metric metric) { return this.matcher.reset(name).matches(); } MetricNameRegexFilter(String regex); }
MetricNameRegexFilter implements MetricFilter { @Override public boolean matches(String name, Metric metric) { return this.matcher.reset(name).matches(); } MetricNameRegexFilter(String regex); @Override boolean matches(String name, Metric metric); }
MetricNameRegexFilter implements MetricFilter { @Override public boolean matches(String name, Metric metric) { return this.matcher.reset(name).matches(); } MetricNameRegexFilter(String regex); @Override boolean matches(String name, Metric metric);  }