During the development and review process of the disk health indicator we noticed that it was hard to understand. Since we learnt a lot from the first round of development we want to go through the code one more time and restructure it.
server/src/test/java/org/elasticsearch/health/node/DiskHealthIndicatorServiceTests.java
assertThat(masterDiagnosisDefinition.cause(), equalTo("Disk is almost full."));
        assertThat(
            masterDiagnosisDefinition.action(),
            equalTo("Please add capacity to the current nodes, or replace them with ones with higher capacity.")
        );
        Diagnosis nonDataNonMasterDiagnosis = diagnosisList.get(2);
        List<String> nonDataNonMasterAffectedResources = nonDataNonMasterDiagnosis.affectedResources();
        assertThat(nonDataNonMasterAffectedResources.size(), equalTo(numberOfRedNonDataNonMasterNodes));
        Diagnosis.Definition nonDataNonMasterDiagnosisDefinition = nonDataNonMasterDiagnosis.definition();
        assertThat(nonDataNonMasterDiagnosisDefinition.cause(), equalTo("Disk is almost full."));
        assertThat(
            nonDataNonMasterDiagnosisDefinition.action(),
            equalTo("Please add capacity to the current nodes, or replace them with ones with higher capacity.")
        );
    }
    public void testGetNodeIdsReportingStatus() {
        Set<DiscoveryNode> discoveryNodes = createNodesWithAllRoles();
        Map<String, DiskHealthInfo> diskInfoByNode = new HashMap<>(discoveryNodes.size());
        Map<HealthStatus, Set<String>> statusToNodeIdMap = new HashMap<>(HealthStatus.values().length);
        for (DiscoveryNode node : discoveryNodes) {
            HealthStatus status = randomFrom(HealthStatus.values());
            final DiskHealthInfo diskHealthInfo = randomBoolean()
                ? new DiskHealthInfo(status)
                : new DiskHealthInfo(status, randomFrom(DiskHealthInfo.Cause.values()));
            Set<String> nodeIdsForStatus = statusToNodeIdMap.computeIfAbsent(status, k -> new HashSet<>());
            nodeIdsForStatus.add(node.getId());
            diskInfoByNode.put(node.getId(), diskHealthInfo);
        }
        for (HealthStatus status : HealthStatus.values()) {
            assertThat(