class CheckedIterator {

    @NonNull
    public static CheckedIterator<String, IOException> fromBufferedReader(@NonNull final BufferedReader reader) {
        return new ACheckedIterator<String, IOException>() {
            @Override
            protected String computeNext() throws IOException {
                String result = reader.readLine();
                return result != null ? result : endOfData();
            }
        };
    }

}