ChannelFilter implements Serializable { public boolean filter(MRecord record){ Collection<String> recordChannels = record.getChannels(); for (String recordChannel : recordChannels){ if (channels.contains(recordChannel)) { return true; } } return false; } ChannelFilter(SubStream<T> subStream); boolean filter(MRecord record);  }
@Test public void filter() { Map<String, Value> values0 = new HashMap<>(); values0.put("channel1", Value.of("test")); values0.put("channelX", Value.of("test")); MRecord record0 = new TypedValues("test", 123L, values0); assertTrue(filter.filter(record0)); Map<String, Value> values1 = new HashMap<>(); values1.put("channel4", Value.of("test")); values1.put("channelX", Value.of("test")); MRecord record1 = new TypedValues("test", 123L, values1); assertTrue(filter.filter(record1)); Map<String, Value> values2 = new HashMap<>(); values2.put("channelX", Value.of("test")); values2.put("channelY", Value.of("test")); MRecord record2 = new TypedValues("test", 123L, values2); assertFalse(filter.filter(record2)); }