@Test
public void TagFilter_should_accept_only_header_with_correct_tag(){

    GarmadonMessageFilter.HeaderFilter nodemanagerFilter = GarmadonMessageFilters.hasTag(Header.Tag.NODEMANAGER);
    GarmadonMessageFilter.HeaderFilter forwarderFilter = GarmadonMessageFilters.hasTag(Header.Tag.FORWARDER);
    EventHeaderProtos.Header noTag = EventHeaderProtos.Header.newBuilder().build();
    EventHeaderProtos.Header tagForwarder = EventHeaderProtos.Header.newBuilder().addTags(Header.Tag.FORWARDER.toString()).build();
    EventHeaderProtos.Header tagNodemanager = EventHeaderProtos.Header.newBuilder().addTags(Header.Tag.NODEMANAGER.toString()).build();
    assertThat(nodemanagerFilter.accepts(random.nextInt(),noTag), is(false));
    assertThat(nodemanagerFilter.accepts(random.nextInt(),tagForwarder), is(false));
    assertThat(nodemanagerFilter.accepts(random.nextInt(),tagNodemanager), is(true));
    assertThat(forwarderFilter.accepts(random.nextInt(),noTag), is(false));
    assertThat(forwarderFilter.accepts(random.nextInt(),tagForwarder), is(true));
    assertThat(forwarderFilter.accepts(random.nextInt(),tagNodemanager), is(false));
}