### Question:
LocalTransactionDataSource implements DataSource { @SuppressWarnings("unchecked") @Override public <T> T unwrap(Class<T> iface) throws SQLException { if (iface == null) { throw new SQLException("iface must not be null"); } if (iface.isAssignableFrom(getClass())) { return (T) this; } return dataSource.unwrap(iface); } LocalTransactionDataSource(DataSource dataSource);  LocalTransactionDataSource(String url, String user, String password); @Override Connection getConnection(); @Override Connection getConnection(String username, String password); @Override int getLoginTimeout(); @Override PrintWriter getLogWriter(); @Override boolean isWrapperFor(Class<?> iface); @Override void setLoginTimeout(int seconds); @Override void setLogWriter(PrintWriter out); @SuppressWarnings("unchecked") @Override T unwrap(Class<T> iface); LocalTransaction getLocalTransaction(JdbcLogger jdbcLogger); LocalTransaction getLocalTransaction(
      JdbcLogger jdbcLogger, TransactionIsolationLevel transactionIsolationLevel); KeepAliveLocalTransaction getKeepAliveLocalTransaction(JdbcLogger jdbcLogger); KeepAliveLocalTransaction getKeepAliveLocalTransaction(
      JdbcLogger jdbcLogger, TransactionIsolationLevel transactionIsolationLevel); @Override Logger getParentLogger();  }### Answer:
@Test public void testUnwrap() throws SQLException { DataSource dataSource = new LocalTransactionDataSource(new MockDataSource()); assertNotNull(dataSource.unwrap(LocalTransactionDataSource.class)); assertNotNull(dataSource.unwrap(MockDataSource.class)); try { dataSource.unwrap(Runnable.class); fail(); } catch (SQLException ignored) { } }