@Override
    @Nonnull
    public <T extends DataConnection> T getAndRetainDataConnection(String name, Class<T> clazz) {
        DataConnectionEntry dataConnection = dataConnections.computeIfPresent(name, (k, v) -> {
            if (!clazz.isInstance(v.instance)) {
                throw new HazelcastException("Data connection '" + name + "' must be an instance of " + clazz);
            }
            v.instance.retain();
            return v;
        });

        if (dataConnection == null) {
            throw new HazelcastException("Data connection '" + name + "' not found");
        }
        //noinspection unchecked
        return (T) dataConnection.instance;
    }
@Test
    public void should_fail_when_non_existing_data_connection() {
        assertThatThrownBy(() -> dataConnectionService.getAndRetainDataConnection("non-existing-data-connection", DummyDataConnection.class))
                .isInstanceOf(HazelcastException.class)
                .hasMessage("Data connection 'non-existing-data-connection' not found");
    }