### Question:
DefaultJdbcComponent implements IJdbcComponent { @Override public synchronized IJdbcClient createShared(String dsName, JdbcOptionsBean config) { if (clients.containsKey(dsName)) { return clients.get(dsName); } else { DataSource ds = datasourceFromConfig(config); DefaultJdbcClient client = new DefaultJdbcClient(ds); clients.put(dsName, client); return client; } } DefaultJdbcComponent(); @Override synchronized IJdbcClient createShared(String dsName, JdbcOptionsBean config); @Override IJdbcClient createStandalone(JdbcOptionsBean config); @Override IJdbcClient create(DataSource ds);  }### Answer:
@Test public void testShared() throws Throwable { DefaultJdbcComponent component = new DefaultJdbcComponent(); JdbcOptionsBean config = new JdbcOptionsBean(); config.setAutoCommit(true); config.setJdbcUrl("jdbc:h2:mem:testShared;DB_CLOSE_DELAY=-1"); config.setUsername("sa"); config.setPassword(""); IJdbcClient client = component.createShared("sharedDS", config); doAllTests(client); }