@Override
    public synchronized DataSource getObject() {
        if (dataSource == null) {
            DatabaseContext databaseContext = databaseContextProvider.getObject();
            dataSource = ProxyFactory.getProxy(DataSource.class, new DatabaseTargetSource(databaseContext));
        }
        return dataSource;
    }
Implementation of the {@link org.springframework.beans.factory.FactoryBean} interface
that provides fully cacheable instances of the embedded postgres database.
embedded-database-spring-test/src/main/java/io/zonky/test/db/context/EmbeddedDatabaseFactoryBean.java