public static IndicesBlockStatus parseBlockSettings(final GetSettingsResponse settingsResponse) {
        IndicesBlockStatus result = new IndicesBlockStatus();
        final ImmutableOpenMap<String, Settings> indexToSettingsMap = settingsResponse.getIndexToSettings();
        final String[] indicesInResponse = indexToSettingsMap.keys().toArray(String.class);
        for (String index : indicesInResponse) {
            final Settings blockSettings = indexToSettingsMap.get(index).getByPrefix(BLOCK_SETTINGS_PREFIX);

            if (!blockSettings.isEmpty()) {
                final Set<String> blockSettingsNames = blockSettings.names();
                final Set<String> blockSettingsSetToTrue = blockSettingsNames.stream()
                        .filter(s -> blockSettings.getAsBoolean(s, false))
                        .map(s -> BLOCK_SETTINGS_PREFIX + s)
                        .collect(Collectors.toSet());
                if (!blockSettingsSetToTrue.isEmpty()) {
                    result.addIndexBlocks(index, blockSettingsSetToTrue);
                }
            }
        }

        return result;
    }
@Test
    public void parserProperlyResponseWithMultipleIndicesWithDifferentBlockSettings() {
        ImmutableOpenMap.Builder<String, Settings> settingsBuilder = new ImmutableOpenMap.Builder<>();
        settingsBuilder.put("index_with_no_block_settings", Settings.builder().put("lalala", 42).build());
        settingsBuilder.put("index_with_false_block_setting", Settings.builder().put("index.blocks.read_only", false).build());
        settingsBuilder.put("index_with_true_block_setting", Settings.builder().put("index.blocks.read_only", true).build());
        settingsBuilder.put("index_with_multiple_true_block_settings", Settings.builder()
                .put("index.blocks.read_only", true)
                .put("index.blocks.read_only_allow_delete", true)
                .build());
        settingsBuilder.put("index_with_mixed_block_settings", Settings.builder()
                .put("index.blocks.read_only", false)
                .put("index.blocks.read_only_allow_delete", true)
                .build());
        GetSettingsResponse settingsResponse = new GetSettingsResponse(settingsBuilder.build(), ImmutableOpenMap.of());
        final IndicesBlockStatus indicesBlockStatus = BlockSettingsParser.parseBlockSettings(settingsResponse);
        assertNotNull(indicesBlockStatus);
        assertEquals(3, indicesBlockStatus.countBlockedIndices());
        final Set<String> blockedIndices = indicesBlockStatus.getBlockedIndices();

        assertFalse(blockedIndices.contains("index_with_no_block_settings"));
        assertFalse(blockedIndices.contains("index_with_false_block_setting"));

        assertTrue(blockedIndices.contains("index_with_true_block_setting"));
        Collection<String> indexBlocks = indicesBlockStatus.getIndexBlocks("index_with_true_block_setting");
        assertEquals(1, indexBlocks.size());
        assertTrue(indexBlocks.contains("index.blocks.read_only"));

        assertTrue(blockedIndices.contains("index_with_multiple_true_block_settings"));
        indexBlocks = indicesBlockStatus.getIndexBlocks("index_with_multiple_true_block_settings");
        assertEquals(2, indexBlocks.size());
        assertTrue(indexBlocks.contains("index.blocks.read_only"));
        assertTrue(indexBlocks.contains("index.blocks.read_only_allow_delete"));

        assertTrue(blockedIndices.contains("index_with_mixed_block_settings"));
        indexBlocks = indicesBlockStatus.getIndexBlocks("index_with_mixed_block_settings");
        assertEquals(1, indexBlocks.size());
        assertFalse(indexBlocks.contains("index.blocks.read_only"));
        assertTrue(indexBlocks.contains("index.blocks.read_only_allow_delete"));


    }