Find out whether a given text contains any of the prohibited words
I may have missed something. But why don't you just use simple collections ?

// Naive implementation
class Text {
  public Text(String content, Set&lt;String&gt; blacklist) {
    this.words = new HashSet&lt;&gt;(Arrays.asList(content.split("\\s")));
    this.blacklist = blacklist;
  }

  public boolean isSafe() {
    for (String forbidden: this.blacklist) {
        if (this.words.contains(forbidden) ) {
            return false;
        }
    }
    return true;
  }
}