### Question:
TagPullMessageFilter implements PullMessageFilter { @Override public boolean isActive(PullRequest request, Buffer message) { TagPullFilter filter = getFilter(request, PullFilterType.TAG); if (filter == null) { return false; } return !noRequestTag(filter); }  @Override boolean isActive(PullRequest request, Buffer message); @Override @SuppressWarnings("all") boolean match(PullRequest request, Buffer message); @Override void init(DynamicConfig config);  }### Answer:
@Test public void testInactiveOnFilterEmpty() throws Exception { Buffer buffer = TestToolBox.createDefaultBuffer(); PullRequest request = TestToolBox.createDefaultPullRequest(); TagPullMessageFilter filter = Mockito.spy(TagPullMessageFilter.class); boolean active = filter.isActive(request, buffer); assertFalse(active); }
@Test public void testInactiveOnNoTag() throws Exception { Buffer buffer = TestToolBox.createDefaultBuffer(); PullRequest request = TestToolBox.createDefaultPullRequest(); request.setFilters(Lists.newArrayList(new TagPullFilter(TagType.NO_TAG, Sets.newHashSet()))); TagPullMessageFilter filter = Mockito.spy(TagPullMessageFilter.class); boolean active = filter.isActive(request, buffer); assertFalse(active); }
@Test public void testActiveOnTagExists() throws Exception { Buffer buffer = TestToolBox.createDefaultBuffer(); PullRequest request = TestToolBox.createDefaultPullRequest(); request.setFilters(Lists.newArrayList(new TagPullFilter(TagType.AND, Sets.newHashSet("tag1", "tag2")))); TagPullMessageFilter filter = Mockito.spy(TagPullMessageFilter.class); boolean active = filter.isActive(request, buffer); assertTrue(active); }