class BlockingOperatorMostRecent {

    public static <T> Iterable<T> mostRecent(final Observable<? extends T> source, final T initialValue) {
        return new Iterable<T>() {
            @Override
            public Iterator<T> iterator() {
                MostRecentObserver<T> mostRecentObserver = new MostRecentObserver<T>(initialValue);

                /**
                 * Subscribe instead of unsafeSubscribe since this is the final subscribe in the chain
                 * since it is for BlockingObservable.
                 */
                source.subscribe(mostRecentObserver);

                return mostRecentObserver.getIterable();
            }
        };
    }

    private  BlockingOperatorMostRecent();

}