HspReader { public static Iterable<HighScoringPair> read(final Readable readable) throws IOException { checkNotNull(readable); Collect collect = new Collect(); stream(readable, collect); return collect.hsps(); } private  HspReader(); static Iterable<HighScoringPair> read(final Readable readable); static void stream(final Readable readable, final HspListener listener);  }
@Test(expected=NullPointerException.class) public void testReadNullReadable() throws Exception { read(null); }
@Test public void testRead() throws Exception { for (HighScoringPair hsp : read(readable)) { assertNotNull(hsp); } }
@Test public void testReadWithCommentLines() throws Exception { int count = 0; for (HighScoringPair hsp : read(new StringReader("# comment line\nsource\ttarget\t99.0\t100\t1\t2\t1\t100\t2\t101\t0.1\t1.0"))) { assertNotNull(hsp); count++; } assertEquals(1, count); }
@Test(expected=IOException.class) public void testReadInvalid() throws Exception { read(new StringReader("invalid")); }