public boolean createDataConnection(DataConnectionCatalogEntry dl, boolean replace, boolean ifNotExists) {
        if (replace) {
            dataConnectionStorage.put(dl.name(), dl);
            listeners.forEach(TableListener::onTableChanged);
            return true;
        } else {
            boolean added = dataConnectionStorage.putIfAbsent(dl.name(), dl);
            if (!added && !ifNotExists) {
                throw QueryException.error("Data connection already exists: " + dl.name());
            }
            if (!added) {
                // report only updates to listener
                listeners.forEach(TableListener::onTableChanged);
            }
            return added;
        }
    }
@Test
    public void when_createsDuplicateDataConnectionIfReplaceAndIfNotExists_then_succeeds() {
        // given
        DataConnectionCatalogEntry dataConnectionCatalogEntry = dataConnection();

        // when
        dataConnectionResolver.createDataConnection(dataConnectionCatalogEntry, false, true);

        // then
        verify(relationsStorage).putIfAbsent(eq(dataConnectionCatalogEntry.name()), isA(DataConnectionCatalogEntry.class));
    }