// Path: src/main/java/junit/rules/util/ObjectUtils.java
// public static <T> boolean nullSafeEquals(final T a, final T b) {
//     if (a == b) {
//         return true;
//     }
//     if (a == null || b == null) {
//         return false;
//     }
//     return a.equals(b);
// }
// 
// Path: src/main/java/junit/rules/util/StringUtils.java
// public static boolean hasLength(final String s) {
//     return s != null && s.length() > 0;
// }


import static junit.rules.util.ObjectUtils.nullSafeEquals;
import static junit.rules.util.StringUtils.hasLength;
import java.io.PrintWriter;
import java.sql.Connection;
import java.sql.Driver;
import java.sql.DriverManager;
import java.sql.SQLException;
import java.util.Enumeration;
import javax.sql.DataSource;
    @Override
    public final boolean isWrapperFor(final Class<?> iface) throws SQLException {
        return DataSource.class.equals(iface);
    }

    /**
     * {@inheritDoc}
     *
     * @see java.sql.Wrapper#unwrap(java.lang.Class)
     */
    @SuppressWarnings("unchecked")
    @Override
    public final <T> T unwrap(final Class<T> iface) throws SQLException {
        if (isWrapperFor(iface)) {
            return (T) this;
        }
        throw new SQLException("DriverManagerDataSource can only be unwrapped as javax.sql.DataSource, not as "
                + iface.getCanonicalName());
    }

    /**
     * {@inheritDoc}
     *
     * @see javax.sql.DataSource#getConnection()
     */
    @Override
    public final Connection getConnection() throws SQLException {
        if (needToRegisterDriver) {
            registerDriver();
        }
// Path: src/main/java/junit/rules/util/ObjectUtils.java
// public static <T> boolean nullSafeEquals(final T a, final T b) {
//     if (a == b) {
//         return true;
//     }
//     if (a == null || b == null) {
//         return false;
//     }
//     return a.equals(b);
// }
// 
// Path: src/main/java/junit/rules/util/StringUtils.java
// public static boolean hasLength(final String s) {
//     return s != null && s.length() > 0;
// }


// Path: src/main/java/junit/rules/jdbc/support/DriverManagerDataSource.java
import static junit.rules.util.ObjectUtils.nullSafeEquals;
import static junit.rules.util.StringUtils.hasLength;
import java.io.PrintWriter;
import java.sql.Connection;
import java.sql.Driver;
import java.sql.DriverManager;
import java.sql.SQLException;
import java.util.Enumeration;
import javax.sql.DataSource;

    @Override
    public final boolean isWrapperFor(final Class<?> iface) throws SQLException {
        return DataSource.class.equals(iface);
    }

    /**
     * {@inheritDoc}
     *
     * @see java.sql.Wrapper#unwrap(java.lang.Class)
     */
    @SuppressWarnings("unchecked")
    @Override
    public final <T> T unwrap(final Class<T> iface) throws SQLException {
        if (isWrapperFor(iface)) {
            return (T) this;
        }
        throw new SQLException("DriverManagerDataSource can only be unwrapped as javax.sql.DataSource, not as "
                + iface.getCanonicalName());
    }

    /**
     * {@inheritDoc}
     *
     * @see javax.sql.DataSource#getConnection()
     */
    @Override
    public final Connection getConnection() throws SQLException {
        if (needToRegisterDriver) {
            registerDriver();
        }
        if (hasLength(jdbcUser) || jdbcPassword != null) {