title: filtering an ArrayList using an object's field
body: <p>I have an ArrayList which is filled by Objects.</p>
  
  <p>My object class called <code>Article</code> which has two fields ;</p>
  
  <pre><code>public class Article {
  
      private int codeArt;
      private String desArt;
  
    public Article(int aInt, String string) {
          this.desArt = string;
          this.codeArt = aInt;
      }
  
      public int getCodeArt() {return codeArt; }
      public void setCodeArt(int codeArt) {this.codeArt = codeArt;}
      public String getDesArt() {return desArt;}
      public void setDesArt(String desArt) { this.desArt = desArt;}
  
  }
  </code></pre>
  
  <p>I want to filter my List using the <code>desArt</code> field, and for test I used the String "test".</p>
  
  <p>I used the Guava from google which allows me to filter an ArrayList.</p>
  
  <p>this is the code I tried :</p>
  
  <pre><code>private List&lt;gestionstock.Article&gt; listArticles = new ArrayList&lt;&gt;();
  
  //Here the I've filled my ArrayList
  
  private List&lt;gestionstock.Article&gt; filteredList filteredList = Lists.newArrayList(Collections2.filter(listArticles, Predicates.containsPattern("test")));
  </code></pre>
  
  <p>but this code isn't working.</p>