@Override
    public <T> T get(String key, Class<T> type) {
        ClusterConfig config = findClusterConfig(key);

        if (config == null) {
            LOG.debug("Couldn't find cluster config of type {}", key);
            return null;
        }

        T result = extractPayload(config.payload(), type);
        if (result == null) {
            LOG.error("Couldn't extract payload from cluster config (type: {})", key);
        }

        return result;
    }
@Test
    public void getReturnsNullOnNonExistingConfig() throws Exception {
        @SuppressWarnings("deprecation")
        final DBCollection collection = mongoConnection.getDatabase().getCollection(COLLECTION_NAME);
        assertThat(collection.count()).isEqualTo(0L);

        assertThat(clusterConfigService.get(CustomConfig.class)).isNull();
    }