@Test
    void maintenance_nodes_in_downed_group_are_not_affected() {
        final ClusterFixture fixture = ClusterFixture
                .forHierarchicCluster(DistributionBuilder.withGroups(3).eachWithNodeCount(3))
                .bringEntireClusterUp()
                .proposeStorageNodeWantedState(3, State.MAINTENANCE)
                .reportStorageNodeState(4, State.DOWN);
        final ClusterStateGenerator.Params params = fixture.generatorParams().minNodeRatioPerGroup(0.68);

        final AnnotatedClusterState state = ClusterStateGenerator.generatedStateFrom(params);
        // 4 is down by itself, 5 is down implicitly and 3 should happily stay in Maintenance mode.
        // Side note: most special cases for when a node should and should not be affected by group
        // down edges are covered in GroupAvailabilityCalculatorTest and GroupAutoTakedownTest.
        // We test this case explicitly since it's an assurance that code integration works as expected.
        assertThat(state.toString(), equalTo("distributor:9 storage:9 .3.s:m .4.s:d .5.s:d"));
    }
Maintenance mode overrides all reported states, even Down.
clustercontroller-core/src/test/java/com/yahoo/vespa/clustercontroller/core/ClusterStateGeneratorTest.java