@Test
public void testReadEachLineHttp() throws Exception {

    HttpServer server = HttpServer.create( new InetSocketAddress( 9668 ), 0 );
    server.createContext( "/test", new MyHandler() );
    server.setExecutor( null ); // creates a default executor
    server.start();
    Thread.sleep( 10 );
    IO.eachLine( "http://localhost:9668/test",
            new IO.EachLine() {
                @Override
                public boolean line( String line, int index ) {
                    if ( index == 0 ) {
                        assertEquals(
                                "line 1", line
                        );
                    } else if ( index == 3 ) {
                        assertEquals(
                                "grapes", line
                        );
                    }
                    return true;
                }
            } );
}