// Path: src/main/java/com/github/davidmoten/rx2/exceptions/AssertionException.java
// public class AssertionException extends RuntimeException {
// 
//     private static final long serialVersionUID = -349922011349921601L;
// 
//     public AssertionException(String message) {
//         super(message);
//     }
// 
// }


import java.io.Closeable;
import java.util.Arrays;
import java.util.List;
import java.util.concurrent.atomic.AtomicBoolean;
import java.util.concurrent.atomic.AtomicInteger;
import java.util.concurrent.atomic.AtomicReference;
import com.github.davidmoten.rx2.exceptions.AssertionException;
import io.reactivex.functions.Consumer;
import io.reactivex.functions.LongConsumer;

            @Override
            public void accept(T t) throws Exception {
                list.add(t);
            }
        };
    }

    @SuppressWarnings("unchecked")
    public static <T> Consumer<T> println() {
        return (Consumer<T>) PrintlnHolder.INSTANCE;
    }

    private static final class PrintlnHolder {
        static final Consumer<Object> INSTANCE = new Consumer<Object>() {
            @Override
            public void accept(Object t) throws Exception {
                System.out.println(t);
            }
        };
    }

    public static Consumer<byte[]> assertBytesEquals(final byte[] expected) {
        // TODO make holder
        return new Consumer<byte[]>() {

            @Override
            public void accept(byte[] array) throws Exception {
                if (!Arrays.equals(expected, array)) {
                    // TODO use custom exception
// Path: src/main/java/com/github/davidmoten/rx2/exceptions/AssertionException.java
// public class AssertionException extends RuntimeException {
// 
//     private static final long serialVersionUID = -349922011349921601L;
// 
//     public AssertionException(String message) {
//         super(message);
//     }
// 
// }


// Path: src/main/java/com/github/davidmoten/rx2/Consumers.java
import java.io.Closeable;
import java.util.Arrays;
import java.util.List;
import java.util.concurrent.atomic.AtomicBoolean;
import java.util.concurrent.atomic.AtomicInteger;
import java.util.concurrent.atomic.AtomicReference;
import com.github.davidmoten.rx2.exceptions.AssertionException;
import io.reactivex.functions.Consumer;
import io.reactivex.functions.LongConsumer;


            @Override
            public void accept(T t) throws Exception {
                list.add(t);
            }
        };
    }

    @SuppressWarnings("unchecked")
    public static <T> Consumer<T> println() {
        return (Consumer<T>) PrintlnHolder.INSTANCE;
    }

    private static final class PrintlnHolder {
        static final Consumer<Object> INSTANCE = new Consumer<Object>() {
            @Override
            public void accept(Object t) throws Exception {
                System.out.println(t);
            }
        };
    }

    public static Consumer<byte[]> assertBytesEquals(final byte[] expected) {
        // TODO make holder
        return new Consumer<byte[]>() {

            @Override
            public void accept(byte[] array) throws Exception {
                if (!Arrays.equals(expected, array)) {
                    // TODO use custom exception
                    throw new AssertionException("arrays not equal: expected=" + Arrays.toString(expected) + ",actual="