// 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.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.when;
import java.io.IOException;
import java.io.InputStream;
import java.io.Reader;
import java.lang.reflect.Method;
import java.math.BigInteger;
import java.sql.Blob;
import java.sql.Clob;
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.SQLException;
import java.time.Instant;
import java.util.List;
import javax.sql.DataSource;
import org.davidmoten.rx.jdbc.exceptions.SQLRuntimeException;
import org.junit.FixMethodOrder;
import org.junit.Test;
import org.junit.runners.MethodSorters;
import org.mockito.Mockito;
import com.github.davidmoten.guavamini.Lists;
    @Test
    public void testAutomapDateToLong() {
        assertEquals(100L, (long) Util.autoMap(new java.sql.Date(100), Long.class));
    }

    @Test
    public void testAutomapDateToBigInteger() {
        assertEquals(100L, ((BigInteger) Util.autoMap(new java.sql.Date(100), BigInteger.class)).longValue());
    }

    @Test
    public void testAutomapDateToInstant() {
        assertEquals(100L, ((Instant) Util.autoMap(new java.sql.Date(100), Instant.class)).toEpochMilli());
    }

    @Test
    public void testAutomapDateToString() {
        assertEquals(100L, ((java.sql.Date) Util.autoMap(new java.sql.Date(100), String.class)).getTime());
    }

    @Test
    public void testConnectionProviderFromDataSource() throws SQLException {
        DataSource d = mock(DataSource.class);
        Connection c = mock(Connection.class);
        ConnectionProvider cp = Util.connectionProvider(d);
        when(d.getConnection()).thenReturn(c);
        assertTrue(c == cp.get());
        cp.close();
    }

// 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/test/java/org/davidmoten/rx/jdbc/UtilTest.java
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.when;
import java.io.IOException;
import java.io.InputStream;
import java.io.Reader;
import java.lang.reflect.Method;
import java.math.BigInteger;
import java.sql.Blob;
import java.sql.Clob;
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.SQLException;
import java.time.Instant;
import java.util.List;
import javax.sql.DataSource;
import org.davidmoten.rx.jdbc.exceptions.SQLRuntimeException;
import org.junit.FixMethodOrder;
import org.junit.Test;
import org.junit.runners.MethodSorters;
import org.mockito.Mockito;
import com.github.davidmoten.guavamini.Lists;

    @Test
    public void testAutomapDateToLong() {
        assertEquals(100L, (long) Util.autoMap(new java.sql.Date(100), Long.class));
    }

    @Test
    public void testAutomapDateToBigInteger() {
        assertEquals(100L, ((BigInteger) Util.autoMap(new java.sql.Date(100), BigInteger.class)).longValue());
    }

    @Test
    public void testAutomapDateToInstant() {
        assertEquals(100L, ((Instant) Util.autoMap(new java.sql.Date(100), Instant.class)).toEpochMilli());
    }

    @Test
    public void testAutomapDateToString() {
        assertEquals(100L, ((java.sql.Date) Util.autoMap(new java.sql.Date(100), String.class)).getTime());
    }

    @Test
    public void testConnectionProviderFromDataSource() throws SQLException {
        DataSource d = mock(DataSource.class);
        Connection c = mock(Connection.class);
        ConnectionProvider cp = Util.connectionProvider(d);
        when(d.getConnection()).thenReturn(c);
        assertTrue(c == cp.get());
        cp.close();
    }

    @Test(expected = SQLRuntimeException.class)