### Question:
FlexyPoolWrapper implements DataSourceWrapper { @Override public DataSource wrap(String name, DataSource dataSource) { if (!(dataSource instanceof HikariDataSource)) { return dataSource; } return wrapInternal(name, (HikariDataSource)dataSource); }  @Override DataSource wrap(String name, DataSource dataSource);  }### Answer:
@Test public void shouldHandleInvalidDataSource() { DataSource dataSource = null; assertThat(wrapper.wrap("", dataSource)).isNull(); }
@Test public void wrapsHikariDataSource() { HikariConfig config = new HikariConfig(); config.setJdbcUrl("jdbc:h2:mem:test_mem"); DataSource dataSource = new HikariDataSource(config); DataSource wrapped = wrapper.wrap("", dataSource); assertThat(wrapped).isInstanceOf(FlexyPoolDataSource.class); }