### Question:
UnpooledDataSource implements DataSource { @Override public Connection getConnection() throws SQLException { return doGetConnection(username, password); } UnpooledDataSource();  UnpooledDataSource(String driver, String url, String username, String password);  UnpooledDataSource(String driver, String url, Properties driverProperties);  UnpooledDataSource(ClassLoader driverClassLoader, String driver, String url, String username, String password);  UnpooledDataSource(ClassLoader driverClassLoader, String driver, String url, Properties driverProperties); @Override Connection getConnection(); @Override Connection getConnection(String username, String password); @Override int getLoginTimeout(); @Override void setLoginTimeout(int loginTimeout); @Override PrintWriter getLogWriter(); @Override void setLogWriter(PrintWriter logWriter); ClassLoader getDriverClassLoader(); void setDriverClassLoader(ClassLoader driverClassLoader); Properties getDriverProperties(); void setDriverProperties(Properties driverProperties); synchronized String getDriver(); synchronized void setDriver(String driver); String getUrl(); void setUrl(String url); String getUsername(); void setUsername(String username); String getPassword(); void setPassword(String password); Boolean isAutoCommit(); void setAutoCommit(Boolean autoCommit); Integer getDefaultTransactionIsolationLevel(); void setDefaultTransactionIsolationLevel(Integer defaultTransactionIsolationLevel); Integer getDefaultNetworkTimeout(); void setDefaultNetworkTimeout(Integer defaultNetworkTimeout); @Override T unwrap(Class<T> iface); @Override boolean isWrapperFor(Class<?> iface); @Override Logger getParentLogger();  }### Answer:
@Test void shouldNotRegisterTheSameDriverMultipleTimes() throws Exception { UnpooledDataSource dataSource = null; dataSource = new UnpooledDataSource("org.hsqldb.jdbcDriver", "jdbc:hsqldb:mem:multipledrivers", "sa", ""); dataSource.getConnection().close(); int before = countRegisteredDrivers(); dataSource = new UnpooledDataSource("org.hsqldb.jdbcDriver", "jdbc:hsqldb:mem:multipledrivers", "sa", ""); dataSource.getConnection().close(); assertEquals(before, countRegisteredDrivers()); }
@Disabled("Requires MySQL server and a driver.") @Test void shouldRegisterDynamicallyLoadedDriver() throws Exception { int before = countRegisteredDrivers(); ClassLoader driverClassLoader = null; UnpooledDataSource dataSource = null; driverClassLoader = new URLClassLoader(new URL[]{new URL("jar:file:/PATH_TO/mysql-connector-java-5.1.25.jar!/")}); dataSource = new UnpooledDataSource(driverClassLoader, "com.mysql.jdbc.Driver", "jdbc:mysql: dataSource.getConnection().close(); assertEquals(before + 1, countRegisteredDrivers()); driverClassLoader = new URLClassLoader(new URL[]{new URL("jar:file:/PATH_TO/mysql-connector-java-5.1.25.jar!/")}); dataSource = new UnpooledDataSource(driverClassLoader, "com.mysql.jdbc.Driver", "jdbc:mysql: dataSource.getConnection().close(); assertEquals(before + 1, countRegisteredDrivers()); }