### Question:
WebLibFinder extends AbstractClassFinder { public WebLibFinder(ServletContext servletContext, ClassLoader classLoader, PackageFilter packageFilter) { super(servletContext, classLoader, packageFilter); } WebLibFinder(ServletContext servletContext, ClassLoader classLoader, PackageFilter packageFilter); void findClasses(PrettyAnnotationHandler classHandler);  }### Answer:
@Test @SuppressWarnings("unchecked") public void testWebLibFinder() throws Exception { URL libUrl = new URL("file:/somewhere/WEB-INF/lib/"); URL jarUrl = new URL("file", null, 0, "/somewhere/WEB-INF/lib/mylib.jar", new TestURLStreamHandler()); Set<String> libDirectory = new HashSet<String>(Arrays.asList("/WEB-INF/lib/mylib.jar")); PackageFilter filter = new PackageFilter(null); ServletContext servletContext = EasyMock.createNiceMock(ServletContext.class); EasyMock.expect(servletContext.getResource("/WEB-INF/lib/")).andReturn(libUrl).anyTimes(); EasyMock.expect(servletContext.getResourcePaths("/WEB-INF/lib/")).andReturn(libDirectory).anyTimes(); EasyMock.expect(servletContext.getResource("/WEB-INF/lib/mylib.jar")).andReturn(jarUrl).anyTimes(); EasyMock.replay(servletContext); ClassLoader classLoader = EasyMock.createNiceMock(ClassLoader.class); EasyMock.expect(classLoader.loadClass("com.ocpsoft.pretty.faces.config.annotation.ClassFinderTestBean")) .andReturn((Class) ClassFinderTestBean.class).anyTimes(); EasyMock.replay(classLoader); PrettyAnnotationHandler handler = EasyMock.createMock(PrettyAnnotationHandler.class); handler.processClass(ClassFinderTestBean.class); EasyMock.expectLastCall().once(); EasyMock.replay(handler); WebLibFinder finder = new WebLibFinder(servletContext, classLoader, filter); finder.findClasses(handler); EasyMock.verify(handler); }