### Question:
RecordLoader { public void load(Reader r, LineHandler lh) throws IOException { BufferedReader br = null; try { br = new BufferedReader(r); br.readLine(); String line; long linenum = 0; while ((line = br.readLine()) != null) { ++linenum; lh.handle(line, linenum); } br.close(); } finally { IOUtils.closeQuietly(br); } }  void load(Reader r, LineHandler lh); void load(InputStream in, LineHandler lh); void load(String filename, LineHandler lh);  }### Answer:
@Test public void loadReader() throws IOException { final LineHandler lh = buildLineHandler(limit, line); final Reader r = new CharSequenceReader(buildInput(limit, line)); final RecordLoader loader = new RecordLoader(); loader.load(r, lh); }
@Test public void loadInputStream() throws IOException { final LineHandler lh = buildLineHandler(limit, line); final RecordLoader loader = new RecordLoader(); InputStream in = null; try { in = IOUtils.toInputStream(buildInput(limit, line).toString()); loader.load(in, lh); in.close(); } finally { IOUtils.closeQuietly(in); } }
@Test public void loadFilename() throws IOException { final LineHandler lh = buildLineHandler(limit, line); final String filename = "src/test/java/com/lightboxtechnologies/nsrl/jackdaws"; final RecordLoader loader = new RecordLoader(); loader.load(filename, lh); }