@Test
public void checkIt() throws IOException {
assertThat(ds, instanceOf(Flushable.class));
assertThat(ds, instanceOf(DataSource.class));
final FlushableDataSourceHandler handler = FlushableDataSourceHandler.class.cast(Proxy.getInvocationHandler(ds));
final CommonDataSource delegate = handler.getDelegate();
assertNotNull(delegate);
assertFalse(BasicDataSource.class.cast(delegate).isClosed());
Flushable.class.cast(ds).flush();
assertTrue(BasicDataSource.class.cast(delegate).isClosed());
final CommonDataSource newDelegate = handler.getDelegate();
assertFalse(BasicDataSource.class.cast(newDelegate).isClosed());
assertNotSame(newDelegate, delegate);
}