### Question:
DefaultWildcardStreamLocator implements WildcardStreamLocator, WildcardExpanderHandlerAware { public InputStream locateStream(final String uri, final File folder) throws IOException { final Collection<File> files = findMatchedFiles(new WildcardContext(uri, folder)); final ByteArrayOutputStream out = new ByteArrayOutputStream(); for (final File file : files) { if (file.isFile()) { final InputStream is = new FileInputStream(file); IOUtils.copy(is, out); is.close(); } else { LOG.debug("Ignoring folder: " + file); } } return new BufferedInputStream(new ByteArrayInputStream(out.toByteArray())); }  static String stripQueryPath(final String path); boolean hasWildcard(final String uri); InputStream locateStream(final String uri, final File folder); void setWildcardExpanderHandler(final Function<Collection<File>, Void> handler); static final String RECURSIVE_WILDCARD; }### Answer:
@Test(expected = IOException.class) public void cannotPassNullArgument() throws IOException { locator.locateStream(null, null); }
@Test(expected = IOException.class) public void cannotPassNullFolder() throws IOException { locator.locateStream("/resource/*.css", null); }
@Test(expected = IOException.class) public void cannotProcessUriWithoutWildcard() throws IOException { final File folder = new File(ClassLoader.getSystemResource("").getFile()); locator.locateStream("/resource/noWildcard.css", folder); }
@Test public void testWithValidFolder() throws IOException { final File folder = new File(ClassLoader.getSystemResource("").getFile()); locator.locateStream("/resource/*.css", folder); }
@Test(expected = IOException.class) public void testWithInvalidFolder() throws IOException { final File folder = new File(ClassLoader.getSystemResource("1.css").getFile()); locator.locateStream("/resource/*.css", folder); }