title: rx-java2: how to safely invoke flatMapSingle
body: <p>I am struggling with rx-java2. Basically, I cannot safely "escape" from <code>Maybe</code> to <code>Single</code> and continue the logic flow for the rest items.
  So here's my simplified code, demonstrating my question:</p>
  
  <pre><code>  public Flowable&lt;Long&gt; run() {
      //let's assume this is my "input" data
      List&lt;UserTask&gt; userTasks;
  
      return Single.just(userTasks)
          .flatMapPublisher(Flowable::fromIterable)
           // userRepository.getUser returns a Maybe&lt;User&gt;
          .map((UserTask ut) -&gt; userRepository.getUser(ut.getName())
                  //search for user
                  //if not found, return a dummy user object
                  .defaultIfEmpty(User.newBuilder().build())
                  //leave dummy user objects only
                  .filter((User u) -&gt; u.getName() == null)
                  //for each dummy user object return a corresponding user task
                  .map(u -&gt; ut)
          )
          .flatMapSingle(Maybe::toSingle)
          .flatMap((UserTask mt) -&gt; {
            // return user related to user task, implementation does not matter
            return Flowable.just(User.newBuilder().build());
          })
          .flatMapSingle(this::saveUser);
    }
  
    private Single&lt;Long&gt; saveUser(User u) {
      return userRepository.saveUser(m).subscribeOn(Schedulers.io());
    }
  </code></pre>
  
  <p>I tried to provide types where needed to ease the understanding.
  The problem here is that in case the <code>Maybe</code> is empty, this line (I guess) <code>.flatMapSingle(Maybe::toSingle)</code> throws an exception <code>NoSuchItemException</code> and the flow execution terminates. Is it possible to improve my code so that if <code>Maybe</code> value is absent, the flow skips this item and goes on?</p>
  
  <p>Please let me know if there's some missing details, I'll provide them.</p>