@@ -0,0 +1,1426 @@
+package com.github.davidmoten.rx;%0A%0Aimport org.slf4j.Logger;%0Aimport org.slf4j.LoggerFactory;%0A%0Aimport rx.Observable;%0Aimport rx.Observer;%0Aimport rx.functions.Func1;%0A%0Apublic class RxUtil %7B%0A%0A%09private static final Logger log = LoggerFactory.getLogger(RxUtil.class);%0A%0A%09public static final %3CT%3E Func1%3CT, T%3E println() %7B%0A%09%09return new Func1%3CT, T%3E() %7B%0A%09%09%09@Override%0A%09%09%09public T call(T t) %7B%0A%09%09%09%09System.out.println(t);%0A%09%09%09%09return t;%0A%09%09%09%7D%0A%09%09%7D;%0A%09%7D%0A%0A%09/**%0A%09 * The first sequence will be emitted in its entirety and ignored before o2%0A%09 * starts emitting.%0A%09 * %0A%09 * @param o1%0A%09 * @param o2%0A%09 * @return%0A%09 */%0A%09@SuppressWarnings(%22unchecked%22)%0A%09public static %3CT%3E Observable%3CT%3E concatButIgnoreFirstSequence(%0A%09%09%09Observable%3C?%3E o1, Observable%3CT%3E o2) %7B%0A%09%09return Observable.concat((Observable%3CT%3E) o1.ignoreElements(), o2);%0A%09%7D%0A%0A%09/**%0A%09 * Logs errors and onNext at info level using slf4j %7B@link Logger%7D.%0A%09 * %0A%09 * @return%0A%09 */%0A%09public static %3CT%3E Observer%3C? super T%3E log() %7B%0A%09%09return new Observer%3CT%3E() %7B%0A%0A%09%09%09@Override%0A%09%09%09public void onCompleted() %7B%0A%09%09%09%09// do nothing%0A%09%09%09%7D%0A%0A%09%09%09@Override%0A%09%09%09public void onError(Throwable e) %7B%0A%09%09%09%09log.error(e.getMessage(), e);%0A%09%09%09%7D%0A%0A%09%09%09@Override%0A%09%09%09public void onNext(T t) %7B%0A%09%09%09%09log.info(t + %22%22);%0A%09%09%09%7D%0A%09%09%7D;%0A%09%7D%0A%0A%09/**%0A%09 * Returns a constant value.%0A%09 * %0A%09 * @param s%0A%09 * @return%0A%09 */%0A%09public static %3CR, S%3E Func1%3CR, S%3E constant(final S s) %7B%0A%09%09return new Func1%3CR, S%3E() %7B%0A%09%09%09@Override%0A%09%09%09public S call(R t1) %7B%0A%09%09%09%09return s;%0A%09%09%09%7D%0A%09%09%7D;%0A%09%7D%0A%0A%7D%0A

add unit tests