The master-is-stable indicator will retrieve useful information
regarding the discovery. This will be useful even if the local
cluster state is not recovered.

We currently do not evaluate the instance-has-master indicator
if the cluster state is not recovered, but we should remove this
constraint once master-is-stable is merged
server/src/test/java/org/elasticsearch/health/HealthServiceTests.java
private static HealthIndicatorService createMockHealthIndicatorService(HealthIndicatorResult result) {
        return new HealthIndicatorService() {
            @Override
            public String name() {
                return result.name();
            }
            @Override
            public String component() {
                return result.component();
            }
            @Override
            public String helpURL() {
                return result.helpURL();
            }
            @Override
            public HealthIndicatorResult calculate(boolean explain) {
                return result;
            }
        };
    }
    private static ClusterService mockEmptyClusterService() {
        return mockClusterService(ClusterState.EMPTY_STATE);
    }
    private static ClusterService mockClusterService(ClusterState clusterState) {
        var clusterService = mock(ClusterService.class);
        when(clusterService.state()).thenReturn(clusterState);
        return clusterService;
    }
}