title: RxJava thread-safety
body: <p>Is this code thread-safe?</p>
  
  <pre><code>Observable&lt;String&gt; observable = ... // some observable that calls
                                      // onNext from a background thread
  
  observable
    .scan(new ArrayList&lt;String&gt;(), (List&lt;String&gt; acc, String next) -&gt; {
      acc.add(next);
      return acc;
    })
    .subscribe( list -&gt; {
      // do somethind with sequence of lists
      ...
    });
  </code></pre>
  
  <p>I'm curious because ArrayList is not a thread-safe data structure.</p>