@Override
    public Host getHost(HostName hostName) throws HostNameNotFoundException {
        ApplicationInstance applicationInstance = serviceMonitor
                .getApplicationNarrowedTo(hostName)
                .orElseThrow(() -> new HostNameNotFoundException(hostName));

        List<ServiceInstance> serviceInstances = applicationInstance
                .serviceClusters().stream()
                .flatMap(cluster -> cluster.serviceInstances().stream())
                .filter(serviceInstance -> hostName.equals(serviceInstance.hostName()))
                .toList();

        HostInfo hostInfo = statusService.getHostInfo(applicationInstance.reference(), hostName);

        return new Host(hostName, hostInfo, applicationInstance.reference(), serviceInstances);
    }
@Test
    public void testGetHost() {
        ClusterControllerClientFactory clusterControllerClientFactory = new ClusterControllerClientFactoryMock();
        StatusService statusService = new ZkStatusService(
                new MockCurator(),
                mock(Metric.class),
                new TestTimer(),
                new DummyAntiServiceMonitor());

        HostName hostName = new HostName("host.yahoo.com");
        TenantId tenantId = new TenantId("tenant");
        ApplicationInstanceId applicationInstanceId =
                new ApplicationInstanceId("applicationInstanceId");
        ApplicationInstanceReference reference = new ApplicationInstanceReference(
                tenantId,
                applicationInstanceId);

        ApplicationInstance applicationInstance =
                new ApplicationInstance(
                        tenantId,
                        applicationInstanceId,
                        Set.of(new ServiceCluster(
                                new ClusterId("clusterId"),
                                new ServiceType("serviceType"),
                                Set.of(new ServiceInstance(
                                               new ConfigId("configId1"),
                                               hostName,
                                               ServiceStatus.UP),
                                       new ServiceInstance(
                                               new ConfigId("configId2"),
                                               hostName,
                                               ServiceStatus.NOT_CHECKED)))));

        ServiceMonitor serviceMonitor = () -> new ServiceModel(Map.of(reference, applicationInstance));

        orchestrator = new OrchestratorImpl(new HostedVespaPolicy(new HostedVespaClusterPolicy(flagSource, zone),
                                                                  clusterControllerClientFactory,
                                                                  applicationApiFactory,
                                                                  flagSource),
                                            clusterControllerClientFactory,
                                            statusService,
                                            serviceMonitor,
                                            0,
                                            new ManualClock(),
                                            applicationApiFactory,
                                            flagSource);

        orchestrator.setNodeStatus(hostName, HostStatus.ALLOWED_TO_BE_DOWN);

        Host host = orchestrator.getHost(hostName);
        assertEquals(reference, host.getApplicationInstanceReference());
        assertEquals(hostName, host.getHostName());
        assertEquals(HostStatus.ALLOWED_TO_BE_DOWN, host.getHostInfo().status());
        assertTrue(host.getHostInfo().suspendedSince().isPresent());
        assertEquals(2, host.getServiceInstances().size());
    }