HeaderRecordFilter implements RecordFilter<P> { @Override public Record<P> processRecord(final Record<P> record) { if (record.getHeader().getNumber() == 1) { return null; } return record; }  @Override Record<P> processRecord(final Record<P> record);  }
@Test public void whenTheRecordNumberIsEqualToOne_ThenItShouldBeFiltered() { when(record.getHeader().getNumber()).thenReturn(1L); assertThat(headerRecordFilter.processRecord(record)).isNull(); }
@Test public void whenTheRecordNumberIsDifferentFromOne_ThenItShouldNotBeFiltered() { when(record.getHeader().getNumber()).thenReturn(2L); assertThat(headerRecordFilter.processRecord(record)).isEqualTo(record); }