### Question:
TagFilter implements Filter { @Override public boolean isLoggable(int priority, String tag) { return pattern.matcher(tag).matches(); } TagFilter(String tagRegex);  TagFilter(Pattern pattern); @Override boolean skipLog(int priority, String tag, String message, Throwable t); @Override boolean isLoggable(int priority, String tag); String getTagRegex(); Pattern getPattern();  }### Answer:
@Test public void isLoggable() { filter = new TagFilter("Filter.*"); assertThat(filter.isLoggable(0, "prout"), is(false)); assertThat(filter.isLoggable(0, "Filter"), is(true)); assertThat(filter.isLoggable(0, "FilterProut"), is(true)); filter = new TagFilter(Pattern.compile("Filter.*")); assertThat(filter.isLoggable(0, "prout"), is(false)); assertThat(filter.isLoggable(0, "Filter"), is(true)); assertThat(filter.isLoggable(0, "FilterProut"), is(true)); }