CSVReader implements Closeable, Iterable<String[]> { public Iterator<String[]> iterator() { try { return new CSVIterator(this); } catch (IOException e) { throw new RuntimeException(e); } } CSVReader(Reader reader);  CSVReader(Reader reader, char separator);  CSVReader(Reader reader, char separator, char quotechar);  CSVReader(Reader reader, char separator, char quotechar, boolean strictQuotes);  CSVReader(Reader reader, char separator,
                     char quotechar, char escape);  CSVReader(Reader reader, char separator, char quotechar, int line);  CSVReader(Reader reader, char separator, char quotechar, char escape, int line);  CSVReader(Reader reader, char separator, char quotechar, char escape, int line, boolean strictQuotes);  CSVReader(Reader reader, char separator, char quotechar, char escape, int line, boolean strictQuotes, boolean ignoreLeadingWhiteSpace);  CSVReader(Reader reader, int line, CSVParser csvParser); List<String[]> readAll(); String[] readNext(); void close(); Iterator<String[]> iterator(); static final int DEFAULT_SKIP_LINES; }
@Test public void canCreateIteratorFromReader() { assertNotNull(csvr.iterator()); }
@Test(expected = RuntimeException.class) public void creatingIteratorForReaderWithNullDataThrowsRuntimeException() throws IOException { Reader mockReader = mock(Reader.class); when(mockReader.read(Matchers.<CharBuffer>any())).thenThrow(new IOException("test io exception")); when(mockReader.read()).thenThrow(new IOException("test io exception")); when(mockReader.read((char[]) notNull())).thenThrow(new IOException("test io exception")); when(mockReader.read((char[]) notNull(), anyInt(), anyInt())).thenThrow(new IOException("test io exception")); csvr = new CSVReader(mockReader); Iterator iterator = csvr.iterator(); }