server/src/test/java/org/elasticsearch/health/node/DiskHealthIndicatorServiceTests.java
.sorted(DiscoveryNode.DISCOVERY_NODE_COMPARATOR)
                    .collect(Collectors.toList());
                assertThat(affectedResources.get(0).getNodes(), equalTo(affectedNodes));
                assertThat(affectedResources.get(1).getType(), is(Diagnosis.Resource.Type.INDEX));
                assertThat(affectedResources.get(1).getValues(), containsInAnyOrder(indexNameToNodeIdsMap.keySet().toArray(new String[0])));
            }
            {
                Diagnosis diagnosis = result.diagnosisList().get(1);
                List<Diagnosis.Resource> affectedResources = diagnosis.affectedResources();
                assertThat(affectedResources.size(), equalTo(1));
                assertThat(affectedResources.get(0).getType(), is(Diagnosis.Resource.Type.NODE));
                assertThat(affectedResources.get(0).getNodes().size(), is(masterNodes.size()));
                List<DiscoveryNode> affectedNodes = masterNodes.stream()
                    .sorted(DiscoveryNode.DISCOVERY_NODE_COMPARATOR)
                    .collect(Collectors.toList());
                assertThat(affectedResources.get(0).getNodes(), equalTo(affectedNodes));
            }
            {
                Diagnosis diagnosis = result.diagnosisList().get(2);
                List<Diagnosis.Resource> affectedResources = diagnosis.affectedResources();
                assertThat(affectedResources.size(), equalTo(1));
                assertThat(affectedResources.get(0).getType(), is(Diagnosis.Resource.Type.NODE));
                assertThat(affectedResources.get(0).getNodes().size(), is(otherNodes.size()));
                List<DiscoveryNode> affectedNodes = otherNodes.stream()
                    .sorted(DiscoveryNode.DISCOVERY_NODE_COMPARATOR)
                    .collect(Collectors.toList());
                assertThat(affectedResources.get(0).getNodes(), equalTo(affectedNodes));
            }
            Map<String, Object> details = xContentToMap(result.details());
            assertThat(details.get("green_nodes"), equalTo(0));