server/src/test/java/org/elasticsearch/health/node/DiskHealthIndicatorServiceTests.java
Collections.emptyMap(),
                    roles,
                    Version.CURRENT
                )
            );
        }
        return discoveryNodes;
    }
    private HealthInfo createHealthInfoWithOneUnhealthyNode(HealthStatus expectedStatus, Set<DiscoveryNode> nodes) {
        return createHealthInfo(new HealthInfoConfig(expectedStatus, 1, nodes));
    }
    private HealthInfo createHealthInfo(HealthInfoConfig healthInfoConfig) {
        return createHealthInfo(List.of(healthInfoConfig));
    }
    private HealthInfo createHealthInfo(List<HealthInfoConfig> healthInfoConfigs) {
        Map<String, DiskHealthInfo> diskInfoByNode = new HashMap<>();
        for (HealthInfoConfig config : healthInfoConfigs) {
            int nodesWithExpectedStatusCount = 0;
            for (DiscoveryNode node : config.nodes) {
                final DiskHealthInfo diskHealthInfo;
                if (nodesWithExpectedStatusCount < config.numberOfUnhealthyNodes) {
                    diskHealthInfo = randomBoolean()
                        ? new DiskHealthInfo(config.unhealthyStatus)
                        : new DiskHealthInfo(config.unhealthyStatus, randomFrom(DiskHealthInfo.Cause.values()));
                    nodesWithExpectedStatusCount++;
                } else {
                    diskHealthInfo = randomBoolean()
                        ? new DiskHealthInfo(HealthStatus.GREEN)
                        : new DiskHealthInfo(HealthStatus.GREEN, randomFrom(DiskHealthInfo.Cause.values()));
                }