title: RxJava 2: BehaviorSubject and Observable.combineLatest issues
body: <p>I'm having some issues with combining both a <code>BehaviorSubject</code> and <code>Observable.combineLatest</code>. I was able to reproduce it in a (smaller) test. Here is a test which is currently failing:</p>
  
  <pre><code>import org.junit.Test;
  
  import java.util.ArrayList;
  import java.util.Arrays;
  import java.util.List;
  
  import io.reactivex.Observable;
  import io.reactivex.observers.TestObserver;
  import io.reactivex.subjects.BehaviorSubject;
  import io.reactivex.subjects.Subject;
  
  import static java.util.Collections.singletonList;
  
  public class MyTest {
  
      @Test
      public void test() {
          Subject&lt;Integer&gt; intSource = BehaviorSubject.createDefault(1);
  
          Subject&lt;List&lt;Observable&lt;Integer&gt;&gt;&gt; mainSubject = 
              BehaviorSubject.createDefault(singletonList(intSource));
  
          TestObserver&lt;List&lt;Integer&gt;&gt; testObserver = 
              mainSubject.flatMap(observables -&gt;
                  Observable.combineLatest(observables, this::castObjectsToInts)
              )
              .test();
  
          List&lt;Observable&lt;Integer&gt;&gt; newValue = new ArrayList&lt;&gt;();
          newValue.add(intSource); // same value as before
          newValue.add(Observable.just(2)); // add another value to this list.
  
          mainSubject.onNext(newValue);
  
          // intSource was already '1', but this is just to 'update' it.
          intSource.onNext(1); // COMMENT OUT THIS LINE
  
          testObserver.assertValueAt(0, singletonList(1));
          testObserver.assertValueAt(1, Arrays.asList(1, 2));
          testObserver.assertValueAt(2, Arrays.asList(1, 2)); // COMMENT OUT THIS LINE
          testObserver.assertValueCount(3); // REPLACE 3 WITH 2
      }
  
      private List&lt;Integer&gt; castObjectsToInts(Object[] objects) {
          List&lt;Integer&gt; ints = new ArrayList&lt;&gt;(objects.length);
          for (Object object : objects) {
              ints.add((Integer) object);
          }
          return ints;
      }
  }
  </code></pre>
  
  <p>(If you comment out both lines with "COMMENT OUT THIS LINE", and replace the last <code>3</code> with a <code>2</code>, the test succeeds.)</p>
  
  <p>Why is this test failing? I don't see anything wrong with the code.</p>