iter = dirs.iterator();  while (iter.hasNext()) { URL dir = (URL) iter.next(); assertNotNull(dir); assertTrue("found non matching dir: "+dir.getPath(), dir.getPath().matches(".*/$")); }  List empty = lister.retrieveListing(url, true, false);
List empty = lister.retrieveListing(ApacheURLListerTest.class.getResource("apache-dir-listing.html"), true, false);
    public void testRetrieveListing() throws Exception {        URL url = new URL("http://www.ibiblio.org/maven/ant/jars/");        ApacheURLLister lister = new ApacheURLLister();        List files = lister.retrieveListing(url, true, false);        assertNotNull(files);        assertTrue(files.size() > 0);        Iterator iter = files.iterator();        while (iter.hasNext()) {            URL file = (URL) iter.next();            assertNotNull(file);            assertTrue("found non matching file: "+file.getPath(), file.getPath().matches(".*/ant/jars/[^/]*$"));        }        // try a directory listing        url = new URL("http://www.ibiblio.org/maven/ant/");        List dirs = lister.retrieveListing(url, false, true);        assertNotNull(dirs);        assertTrue(dirs.size() > 0);        iter = dirs.iterator();        while (iter.hasNext()) {            URL dir = (URL) iter.next();            assertNotNull(dir);            assertTrue("found non matching dir: "+dir.getPath(), dir.getPath().matches(".*/$"));        }        List empty = lister.retrieveListing(url, true, false);        assertTrue(empty.isEmpty());    }