src/main/java/io/reactivex/Observable.java
@CheckReturnValue
    @SchedulerSupport(SchedulerSupport.NONE)
    public final Observable<T> distinctUntilChanged(BiPredicate<? super T, ? super T> comparer) {
        ObjectHelper.requireNonNull(comparer, "comparer is null");
        return RxJavaPlugins.onAssembly(new ObservableDistinctUntilChanged<T, T>(this, Functions.<T>identity(), comparer));
    }
@CheckReturnValue
    @SchedulerSupport(SchedulerSupport.NONE)
    public final Observable<T> distinctUntilChanged(BiPredicate<? super T, ? super T> comparer) {
        ObjectHelper.requireNonNull(comparer, "comparer is null");
        return RxJavaPlugins.onAssembly(new ObservableDistinctUntilChanged<T, T>(this, Functions.<T>identity(), comparer));
    }
@ CheckReturnValue @ SchedulerSupport ( SchedulerSupport . NONE ) public final Observable < T > distinctUntilChanged ( BiPredicate < ? super T , ? super T > comparer ) { ObjectHelper . requireNonNull ( comparer , "comparer is null" ) ; return RxJavaPlugins . onAssembly ( new ObservableDistinctUntilChanged < T , T > ( this , Functions . < T > identity ( ) , comparer ) ) ; }
Returns an Observable that emits all items emitted by the source ObservableSource that are distinct from their
immediate predecessors when compared with each other via the provided comparator function.
<p>
<img width="640" height="310" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/distinctUntilChanged.png" alt="">
<p>
Note that the operator always retains the latest item from upstream regardless of the comparison result
and uses it in the next comparison with the next upstream item.
<p>
Note that if element type {@code T} in the flow is mutable, the comparison of the previous and current
item may yield unexpected results if the items are mutated externally. Common cases are mutable
{@code CharSequence}s or {@code List}s where the objects will actually have the same
references when they are modified and {@code distinctUntilChanged} will evaluate subsequent items as same.
To avoid such situation, it is recommended that mutable data is converted to an immutable one,
for example using {@code map(CharSequence::toString)} or {@code map(list -> Collections.unmodifiableList(new ArrayList<>(list)))}.
<dl>
<dt><b>Scheduler:</b></dt>
<dd>{@code distinctUntilChanged} does not operate by default on a particular {@link Scheduler}.</dd>
</dl>

@param comparer the function that receives the previous item and the current item and is
expected to return true if the two are equal, thus skipping the current value.
@return an Observable that emits those items from the source ObservableSource that are distinct from their
immediate predecessors
@see <a href="http://reactivex.io/documentation/operators/distinct.html">ReactiveX operators documentation: Distinct</a>
@since 2.0
Returns an Observable that emits all items emitted by the source ObservableSource that are distinct from their immediate predecessors when compared with each other via the provided comparator function . <p > <img width = 640 height = 310 src = https : // raw . github . com / wiki / ReactiveX / RxJava / images / rx - operators / distinctUntilChanged . png alt = > <p > Note that the operator always retains the latest item from upstream regardless of the comparison result and uses it in the next comparison with the next upstream item . <p > Note that if element type { @code T } in the flow is mutable the comparison of the previous and current item may yield unexpected results if the items are mutated externally . Common cases are mutable { @code CharSequence } s or { @code List } s where the objects will actually have the same references when they are modified and { @code distinctUntilChanged } will evaluate subsequent items as same . To avoid such situation it is recommended that mutable data is converted to an immutable one for example using { @code map ( CharSequence :: toString ) } or { @code map ( list - > Collections . unmodifiableList ( new ArrayList< > ( list ))) } . <dl > <dt > <b > Scheduler : < / b > < / dt > <dd > { @code distinctUntilChanged } does not operate by default on a particular { @link Scheduler } . < / dd > < / dl >