@Test
public void shouldReturnLessThanRequestedBatchSizeIfNothingMoreToRead() throws Exception {

    // given
    StringReader reader = csvEntriesReader(10).usingDelimiter(";").withEntries(10, "entry_%d", "column1", "column2").build();
    CsvListReader csvReader = new CsvListReader(reader, csvPreference(config));
    CsvParameterEntryBatchLoader batchLoader = new CsvParameterEntryBatchLoader(csvReader);
    // when
    List<ParameterEntry> entries = new ArrayList<ParameterEntry>();
    entries.addAll(batchLoader.nextBatch(15));
    // then
    assertThat(entries).hasSize(10);
}