### Question:
FASTAParser { public FASTARecord next() throws IOException { if (lastLine == null) return null; assert lastLine.startsWith(">"); while (true) { if (lastLine != null && !lastLine.isEmpty()) recordBuffer.add(lastLine); lastLine = reader.readLine(); if (lastLine == null || lastLine.startsWith(">")) break; } return buildRecord(); } FASTAParser(File file);  FASTAParser(InputStream stream); FASTARecord next();  }### Answer:
@Test public void test() throws IOException { FASTAParser parser = new FASTAParser(stream); FASTARecord first = parser.next(); Assert.assertEquals("1", first.getID()); Assert.assertEquals("comment 1", first.getComment()); Assert.assertEquals("ACGTAACTACGT", first.getSequence()); FASTARecord second = parser.next(); Assert.assertEquals("2", second.getID()); Assert.assertEquals("comment 2", second.getComment()); Assert.assertEquals("AAAA", second.getSequence()); FASTARecord third = parser.next(); Assert.assertNull(third); }