public static List<HostName> getClusterControllerInstancesInOrder(ApplicationInstance application,
                                                                      ClusterId contentClusterId)
    {
        Set<ServiceCluster> controllerClusters = getClusterControllerServiceClusters(application);

        Collection<ServiceCluster> controllerClustersForContentCluster = filter(controllerClusters, contentClusterId);

        Set<ServiceInstance> clusterControllerInstances;
        if (controllerClustersForContentCluster.size() == 1) {
            clusterControllerInstances = first(controllerClustersForContentCluster).serviceInstances();
        } else if (controllerClusters.size() == 1) {
            clusterControllerInstances = first(controllerClusters).serviceInstances();
        } else {
            throw new RuntimeException("Failed getting cluster controller for content cluster " + contentClusterId +
                    ". Available clusters = " + controllerClusters +
                    ", matching clusters = " + controllerClustersForContentCluster);
        }

        return clusterControllerInstances.stream()
                .sorted(CLUSTER_CONTROLLER_INDEX_COMPARATOR)
                .map(serviceInstance -> serviceInstance.hostName())
                .toList();
    }
@Test
    public void testGettingClusterControllerInstances() {
        List<HostName> controllers = VespaModelUtil.getClusterControllerInstancesInOrder(application, CONTENT_CLUSTER_ID);
        List<HostName> expectedControllers = List.of(controller0.hostName(), controller1.hostName());

        assertEquals(expectedControllers, controllers);
    }