@Override
    public void close() throws IOException {
        if (this.targetDataSource instanceof final Closeable closeable) {
            closeable.close();
        }
    }
This is {@link DefaultCloseableDataSource}.

@author Misagh Moayyed
@since 6.4.0
support/cas-server-support-jpa-util/src/main/java/org/apereo/cas/configuration/support/DefaultCloseableDataSource.java