@Nullable
    @Override
    public RecordAndPosition<E> next() {
        if (records.hasNext()) {
            recordAndPosition.setNext(records.next());
            return recordAndPosition;
        } else {
            return null;
        }
    }
@Test
    void testGetElements() {
        final String[] elements = new String[] {"1", "2", "3", "4"};
        final long initialPos = 1422;
        final long initialSkipCount = 17;

        final IteratorResultIterator<String> iter =
                new IteratorResultIterator<>(
                        Arrays.asList(elements).iterator(), initialPos, initialSkipCount);

        for (int i = 0; i < elements.length; i++) {
            final RecordAndPosition<String> recAndPos = iter.next();
            assertThat(recAndPos.getRecord()).isEqualTo(elements[i]);
            assertThat(recAndPos.getOffset()).isEqualTo(initialPos);
            assertThat(recAndPos.getRecordSkipCount()).isEqualTo(initialSkipCount + i + 1);
        }
    }