// Path: rxjava2-jdbc/src/main/java/org/davidmoten/rx/jdbc/ResultSetMapper.java
// public interface ResultSetMapper<T> extends Function<ResultSet, T>{
// 
//     @Override
//     T apply(@Nonnull ResultSet rs) throws SQLException;
// }
// 
// Path: rxjava2-jdbc/src/main/java/org/davidmoten/rx/jdbc/exceptions/SQLRuntimeException.java
// public class SQLRuntimeException extends RuntimeException {
// 
//     private static final long serialVersionUID = -3879393806890615797L;
// 
//     public SQLRuntimeException(Throwable e) {
//         super(e);
//     }
// 
//     public SQLRuntimeException(String message) {
//         super(message);
//     }
// 
// }


import static org.davidmoten.rx.jdbc.Util.mapObject;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.ArrayList;
import java.util.List;
import org.davidmoten.rx.jdbc.ResultSetMapper;
import org.davidmoten.rx.jdbc.exceptions.SQLRuntimeException;
import com.github.davidmoten.guavamini.Preconditions;
        return new ResultSetMapper<Tuple7<T1, T2, T3, T4, T5, T6, T7>>() {
            @Override
            public Tuple7<T1, T2, T3, T4, T5, T6, T7> apply(ResultSet rs) {
                return new Tuple7<T1, T2, T3, T4, T5, T6, T7>(mapObject(rs, cls1, 1),
                        mapObject(rs, cls2, 2), mapObject(rs, cls3, 3),
                        mapObject(rs, cls4, 4), mapObject(rs, cls5, 5),
                        mapObject(rs, cls6, 6), mapObject(rs, cls7, 7));
            }
        };
    }

    public static <T> ResultSetMapper<TupleN<T>> tupleN(final Class<T> cls) {
        Preconditions.checkNotNull(cls, "cls cannot be null");
        return new ResultSetMapper<TupleN<T>>() {
            @Override
            public TupleN<T> apply(ResultSet rs) {
                return toTupleN(cls, rs);
            }
        };
    }

    private static <T> TupleN<T> toTupleN(final Class<T> cls, ResultSet rs) {
        try {
            int n = rs.getMetaData().getColumnCount();
            List<T> list = new ArrayList<T>();
            for (int i = 1; i <= n; i++) {
                list.add(mapObject(rs, cls, i));
            }
            return new TupleN<T>(list);
        } catch (SQLException e) {
// Path: rxjava2-jdbc/src/main/java/org/davidmoten/rx/jdbc/ResultSetMapper.java
// public interface ResultSetMapper<T> extends Function<ResultSet, T>{
// 
//     @Override
//     T apply(@Nonnull ResultSet rs) throws SQLException;
// }
// 
// Path: rxjava2-jdbc/src/main/java/org/davidmoten/rx/jdbc/exceptions/SQLRuntimeException.java
// public class SQLRuntimeException extends RuntimeException {
// 
//     private static final long serialVersionUID = -3879393806890615797L;
// 
//     public SQLRuntimeException(Throwable e) {
//         super(e);
//     }
// 
//     public SQLRuntimeException(String message) {
//         super(message);
//     }
// 
// }


// Path: rxjava2-jdbc/src/main/java/org/davidmoten/rx/jdbc/tuple/Tuples.java
import static org.davidmoten.rx.jdbc.Util.mapObject;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.ArrayList;
import java.util.List;
import org.davidmoten.rx.jdbc.ResultSetMapper;
import org.davidmoten.rx.jdbc.exceptions.SQLRuntimeException;
import com.github.davidmoten.guavamini.Preconditions;

        return new ResultSetMapper<Tuple7<T1, T2, T3, T4, T5, T6, T7>>() {
            @Override
            public Tuple7<T1, T2, T3, T4, T5, T6, T7> apply(ResultSet rs) {
                return new Tuple7<T1, T2, T3, T4, T5, T6, T7>(mapObject(rs, cls1, 1),
                        mapObject(rs, cls2, 2), mapObject(rs, cls3, 3),
                        mapObject(rs, cls4, 4), mapObject(rs, cls5, 5),
                        mapObject(rs, cls6, 6), mapObject(rs, cls7, 7));
            }
        };
    }

    public static <T> ResultSetMapper<TupleN<T>> tupleN(final Class<T> cls) {
        Preconditions.checkNotNull(cls, "cls cannot be null");
        return new ResultSetMapper<TupleN<T>>() {
            @Override
            public TupleN<T> apply(ResultSet rs) {
                return toTupleN(cls, rs);
            }
        };
    }

    private static <T> TupleN<T> toTupleN(final Class<T> cls, ResultSet rs) {
        try {
            int n = rs.getMetaData().getColumnCount();
            List<T> list = new ArrayList<T>();
            for (int i = 1; i <= n; i++) {
                list.add(mapObject(rs, cls, i));
            }
            return new TupleN<T>(list);
        } catch (SQLException e) {
            throw new SQLRuntimeException(e);