src/main/java/io/reactivex/Observable.java
@CheckReturnValue
    @SchedulerSupport(SchedulerSupport.NONE)
    public final <K> Observable<T> distinct(Function<? super T, K> keySelector, Callable<? extends Collection<? super K>> collectionSupplier) {
        ObjectHelper.requireNonNull(keySelector, "keySelector is null");
        ObjectHelper.requireNonNull(collectionSupplier, "collectionSupplier is null");
        return RxJavaPlugins.onAssembly(new ObservableDistinct<T, K>(this, keySelector, collectionSupplier));
    }
@CheckReturnValue
    @SchedulerSupport(SchedulerSupport.NONE)
    public final <K> Observable<T> distinct(Function<? super T, K> keySelector, Callable<? extends Collection<? super K>> collectionSupplier) {
        ObjectHelper.requireNonNull(keySelector, "keySelector is null");
        ObjectHelper.requireNonNull(collectionSupplier, "collectionSupplier is null");
        return RxJavaPlugins.onAssembly(new ObservableDistinct<T, K>(this, keySelector, collectionSupplier));
    }
Returns an Observable that emits all items emitted by the source ObservableSource that are distinct according
to a key selector function and based on {@link Object#equals(Object)} comparison of the objects
returned by the key selector function.
<p>
<img width="640" height="310" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/distinct.key.png" alt="">
<p>
It is recommended the keys' class {@code K} overrides the default {@code Object.equals()}
and {@link Object#hashCode()}  to provide meaningful comparison between the key objects as
the default Java implementation only considers reference equivalence.
<dl>
<dt><b>Scheduler:</b></dt>
<dd>{@code distinct} does not operate by default on a particular {@link Scheduler}.</dd>
</dl>

@param <K> the key type
@param keySelector
a function that projects an emitted item to a key value that is used to decide whether an item
is distinct from another one or not
@param collectionSupplier
function called for each individual Observer to return a Collection subtype for holding the extracted
keys and whose add() method's return indicates uniqueness.
@return an Observable that emits those items emitted by the source ObservableSource that have distinct keys
@see <a href="http://reactivex.io/documentation/operators/distinct.html">ReactiveX operators documentation: Distinct</a>