src/main/java/io/reactivex/Observable.java
@CheckReturnValue
    @SchedulerSupport(SchedulerSupport.NONE)
    public final <U> Observable<T> sample(ObservableSource<U> sampler) {
        ObjectHelper.requireNonNull(sampler, "sampler is null");
        return RxJavaPlugins.onAssembly(new ObservableSampleWithObservable<T>(this, sampler, false));
    }
@CheckReturnValue
    @SchedulerSupport(SchedulerSupport.NONE)
    public final <U> Observable<T> sample(ObservableSource<U> sampler) {
        ObjectHelper.requireNonNull(sampler, "sampler is null");
        return RxJavaPlugins.onAssembly(new ObservableSampleWithObservable<T>(this, sampler, false));
    }
Returns an Observable that, when the specified {@code sampler} ObservableSource emits an item or completes,
emits the most recently emitted item (if any) emitted by the source ObservableSource since the previous
emission from the {@code sampler} ObservableSource.
<p>
<img width="640" height="289" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/sample.o.nolast.png" alt="">
<dl>
<dt><b>Scheduler:</b></dt>
<dd>This version of {@code sample} does not operate by default on a particular {@link Scheduler}.</dd>
</dl>

@param <U> the element type of the sampler ObservableSource
@param sampler
the ObservableSource to use for sampling the source ObservableSource
@return an Observable that emits the results of sampling the items emitted by this ObservableSource whenever
the {@code sampler} ObservableSource emits an item or completes
@see <a href="http://reactivex.io/documentation/operators/sample.html">ReactiveX operators documentation: Sample</a>