StopWord { public boolean has(String text, LOCATION location) { switch (location) { case CONTAINS: return contains(text); case EQUAL: return isStopWord(text); case ANY: return contains(text); case EDGE: return hasEdge(text); case LEADING: return hasLeading(text); case TRAILING: return hasTrailing(text); } return contains(text); } StopWord(Path file);  StopWord(Path file, Charset charset); void caseSensitive(final boolean bool); void ignorePunctuation(final boolean bool); void load(); boolean isStopWord(final String token); boolean isStopWord(final String... token); boolean isStopWord(final List<String> token); boolean has(String text, LOCATION location); boolean has(String[] text, LOCATION location); boolean has(List<String> text, LOCATION location); boolean hasLeading(final String text); boolean hasLeading(final String... text); boolean hasLeading(final Collection<String> text); boolean hasTrailing(final String text); boolean hasTrailing(final String... text); boolean hasTrailing(final List<String> text); boolean hasEdge(final String text); boolean hasEdge(List<String> text); boolean hasEdge(String[] text); boolean contains(final String text); boolean contains(final String... text); boolean contains(final Collection<String> text); String remove(final String text); String[] remove(final String... text); List<String> remove(final Iterable<String> text); String remove(char[] text, LOCATION location); String remove(String text, LOCATION location); List<String> remove(List<String> text, LOCATION location); String[] remove(String[] text, LOCATION location); String removeLeading(String text); String[] removeLeading(String... text); List<String> removeLeading(Collection<String> text); String removeTrailing(String text); String[] removeTrailing(String... text); List<String> removeTrailing(List<String> text); String removeEdge(String text); String[] removeEdge(String... text); List<String> removeEdge(List<String> text);  }
@Test public void stopWordLeadingLocation() throws IOException { assertTrue(stopword.has("the mountain", StopWord.LOCATION.LEADING)); }