title: Execute 2 observables sequentially and get the result at once - RxJava 2
body: <p>I have this function: </p>
  
  <pre><code>public static class CombinedResult&lt;T, R&gt; {
      T t;
      R r;
  
      public CombinedResult(T t, R r) {
          this.t = t;
          this.r = r;
      }
  
      public T getObject1() {
          return t;
      }
  
      public void setObject1(T t) {
          this.t = t;
      }
  
      public R getObject2() {
          return r;
      }
  
      public void setObject2(R r) {
          this.r = r;
      }
  
  }
  
  public static &lt;A, B&gt; Observable&lt;CombinedResult&lt;A, B&gt;&gt; combineObservablesParallel(Observable&lt;A&gt;
      return Observable.zip(observable1, observable2, new BiFunction&lt;A, B, CombinedResult&lt;A, B&gt;&gt;() {
          @Override
          public CombinedResult&lt;A, B&gt; apply(A a, B b) throws Exception {
              return new CombinedResult&lt;&gt;(a,b);
          }
      });
  }
  </code></pre>
  
  <p>It combine <strong>2</strong> observables and return <strong>1</strong> Observable, which will get the result of both observables into <code>CombinedResult</code> object, The problem here is <strong><code>zip</code></strong> function combine the observables on Paralllel.</p>
  
  <p>I want something same as <code>zip</code> that executes the observable sequentially and return the result in <code>BiFunction</code> or something like this. </p>
  
  <p>what can be the solution ?</p>