TextUtils { public static Set<String> readStopwordsURL(URL url, boolean lowercase) throws IOException { return readStopwordsInputStream(url.openStream(), lowercase); }  static Set<String> readStopwordsFile(File file, boolean lowercase); static Set<String> readStopwordsFile(String location, boolean lowercase); static Set<String> readStopwordsInputStream(InputStream inputStream, boolean lowercase); static Set<String> readStopwordsPath(Path path, boolean lowercase); static Set<String> readStopwordsURL(URL url, boolean lowercase);  }
@Test public void testReadStopwordsURL() throws Exception { URL stopwordsURL = getClass().getResource("/stopwords.txt"); Set<String> stopwords = TextUtils.readStopwordsURL(stopwordsURL, false); assertEquals(EXPECTED_STOPWORDS, stopwords); }