@Override
    public OUT nextRecord(OUT record) throws IOException {
        OUT returnRecord = null;
        do {
            returnRecord = super.nextRecord(record);
        } while (returnRecord == null && !reachedEnd());

        return returnRecord;
    }
@Test
    void testDoubleFields() {
        try {
            final String fileContent = "11.1|22.2|33.3|44.4|55.5\n66.6|77.7|88.8|99.9|00.0|\n";
            final FileInputSplit split = createTempFile(fileContent);

            final TupleTypeInfo<Tuple5<Double, Double, Double, Double, Double>> typeInfo =
                    TupleTypeInfo.getBasicTupleTypeInfo(
                            Double.class, Double.class, Double.class, Double.class, Double.class);
            final CsvInputFormat<Tuple5<Double, Double, Double, Double, Double>> format =
                    new TupleCsvInputFormat<>(PATH, typeInfo);

            format.setFieldDelimiter("|");

            format.configure(new Configuration());
            format.open(split);

            Tuple5<Double, Double, Double, Double, Double> result = new Tuple5<>();

            result = format.nextRecord(result);
            assertThat(result.f0).isEqualTo(Double.valueOf(11.1));
            assertThat(result.f1).isEqualTo(Double.valueOf(22.2));
            assertThat(result.f2).isEqualTo(Double.valueOf(33.3));
            assertThat(result.f3).isEqualTo(Double.valueOf(44.4));
            assertThat(result.f4).isEqualTo(Double.valueOf(55.5));

            result = format.nextRecord(result);
            assertThat(result.f0).isEqualTo(Double.valueOf(66.6));
            assertThat(result.f1).isEqualTo(Double.valueOf(77.7));
            assertThat(result.f2).isEqualTo(Double.valueOf(88.8));
            assertThat(result.f3).isEqualTo(Double.valueOf(99.9));
            assertThat(result.f4).isEqualTo(Double.valueOf(00.0));

            result = format.nextRecord(result);
            assertThat(result).isNull();
            assertThat(format.reachedEnd()).isTrue();
        } catch (Exception ex) {
            fail("Test failed due to a " + ex.getClass().getName() + ": " + ex.getMessage());
        }
    }