title: Using flatMapIterable() in RxJava2
body: <p>I'm just starting out with RxJava and trying a sample project.</p>
  
  <p>What I'm trying to achieve is  </p>
  
  <p>-> Get an object -> 
  which contains a list of sub-objects -> Check if the sub-list satisfies a predicate condition -> and emit the sub-objects if satisfies</p>
  
  <p>This is my POJO</p>
  
  <pre><code>public class UpComingMovies {
  
  @SerializedName("results")
    private List&lt;Movies&gt; results;
  }
  
  public class Movies {
  
  @SerializedName("overview")
    private String overview;
  
  @SerializedName("original_language")
    private String originalLanguage;
  }
  </code></pre>
  
  <p>So, from what I understand is that I can use <code>flatMapIterable</code> and transform the item to multiple observables and then use <code>filter</code> saying give me movies which has <code>originalLanguage.equals("en")</code></p>
  
  <p>This is what I have tried to do</p>
  
  <pre><code> @GET("movie/upcoming")
  Observable&lt;UpComingMovies&gt; getUpComingMovies(@Query("api_key") String apiKey, @Query("page") String page);
  
  private final CompositeDisposable disposables = new CompositeDisposable();
  
  @Override
  protected void onCreate(Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);
      setContentView(R.layout.activity_main);
  
       disposables.add(RetrofitConnection.getService()
              .getUpComingMovies(Config.API_KEY, "1")
              .flatMapIterable(new Function&lt;UpComingMovies, Iterable&lt;Movies&gt;&gt;() {
                  @Override
                  public Iterable&lt;Movies&gt; apply(@NonNull UpComingMovies upComingMovies) throws Exception {
                      // no instance(s) of the type variable(s) U exist so that the Observable&lt;U&gt; conforms to a disposable
                      return upComingMovies.getResults();
                  }
              })
              .filter(movies -&gt; movies.getVoteCount() &gt; 200).subscribeOn(Schedulers.io())
              .observeOn(AndroidSchedulers.mainThread())
              .subscribe(new DisposableObserver&lt;Movies&gt;() {
                  @Override
                  public void onNext(@NonNull Movies movies) {
  
                  }
  
                  @Override
                  public void onError(@NonNull Throwable e) {
  
                  }
  
                  @Override
                  public void onComplete() {
  
                  }
              }));
  }
  </code></pre>
  
  <p>However, it does not compile. 
  Cleary I do not know how to do this, any help is appreciated</p>