title: RxJava2 filter List<Object>
body: <p>I'm trying to filter a List with RxJava2 such that each item (object) in the list should pass a validation check and I get a resulting List with only items that pass that test. For instance if my Object had the following structure,</p>
  
  <pre><code>class MyClassA {
      int value1;
      int value2;
  }
  </code></pre>
  
  <p>I want to only get the list of items where the <code>value2</code> is 10.</p>
  
  <p>I have an API call function that returns an Observable of List, i.e. <code>Observable&lt;List&lt;MyClassA&gt;&gt;</code> as follows,</p>
  
  <pre><code>apiService.getListObservable()
      .subscribeOn(Schedulers.io)
      .observeOn(AndroidSchedulers.mainThread());
  </code></pre>
  
  <p>and I would like to have the output filtered, so I tried adding a <code>.filter()</code> operator to the above but it seems to require a <code>Predicate&lt;List&lt;MyClassA&gt;&gt;</code> instead of just a <code>MyClassA</code> object with which I can check and allow only ones where <code>value2 == 10</code>.</p>
  
  <p>I'm pretty new to RxJava and RxJava2 and seems like I'm missing something basic here?</p>
  
  <p>TIA</p>