### Question:
TagFilter implements Filter { @Override public boolean skipLog(int priority, String tag, String message, Throwable t) { 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 skipLog() { filter = new TagFilter("Filter.*"); assertThat(filter.skipLog(0, "prout", "pouet", null), is(true)); assertThat(filter.skipLog(0, "Filter", "pouet", null), is(false)); assertThat(filter.skipLog(0, "FilterProut", "pouet", null), is(false)); filter = new TagFilter(Pattern.compile("Filter.*")); assertThat(filter.skipLog(0, "prout", "pouet", null), is(true)); assertThat(filter.skipLog(0, "Filter", "pouet", null), is(false)); assertThat(filter.skipLog(0, "FilterProut", "pouet", null), is(false)); }