title: Java 8 filtering a string
body: <p>I have a method to remove some characters from a string. Is there a better way to do this using java 8?</p>
  
  <pre><code>public String filter(String test) {
      StringBuilder builder = new StringBuilder();
      for (int i = 0; i &lt; test.length(); i++) {
          if (MYCOLLECTION.contains(test.charAt(i))) {
              builder .append(test.charAt(i));
          }
      }
      return builder .toString();
  }
  </code></pre>