@Override
    public Headers add(Header header) throws IllegalStateException {
        Objects.requireNonNull(header, "Header cannot be null.");
        canWrite();
        headers.add(header);
        return this;
    }
@Test
    public void shouldThrowNpeWhenAddingNullHeader() {
        final RecordHeaders recordHeaders = new RecordHeaders();
        assertThrows(NullPointerException.class, () -> recordHeaders.add(null));
    }