### Question:
CsvDatasetReader extends AbstractDataset { @Override public long size() { if (size == -1) { try (InputStream inputStream = config.openInputStream()) { int lineNumber = FileHelper.getNumberOfLines(inputStream); size = Math.min(config.readHeader() ? lineNumber - 1 : lineNumber, config.getLimit()); } catch (IOException e) { throw new IllegalStateException("IOException for" + config.filePath()); } } return size; } @Deprecated  CsvDatasetReader(File filePath); @Deprecated  CsvDatasetReader(File filePath, boolean readHeader); @Deprecated  CsvDatasetReader(File filePath, boolean readHeader, String fieldSeparator);  CsvDatasetReader(CsvDatasetReaderConfig config); @Deprecated List<Instance> readAll(); @Override CloseableIterator<Instance> iterator(); @Override FeatureInformation getFeatureInformation(); @Override long size();  }### Answer:
@Test public void testSize() throws IOException { Builder config = CsvDatasetReaderConfig.filePath(getResourceFile("/classifier/adultData.txt")); config.readHeader(false); config.readClassFromLastColumn(true); config.setFieldSeparator(";"); CsvDatasetReader reader = config.create(); assertEquals(1000, reader.size()); }