public static Optional<ServiceInstance> getStorageNodeAtHost(ApplicationInstance application, 
                                                                        HostName hostName) {
        Set<ServiceInstance> storageNodesOnHost = application.serviceClusters().stream()
                .filter(VespaModelUtil::isStorage)
                .flatMap(cluster -> cluster.serviceInstances().stream())
                .filter(service -> service.hostName().equals(hostName))
                .collect(Collectors.toSet());

        if (storageNodesOnHost.isEmpty()) {
            return Optional.empty();
        }

        if (storageNodesOnHost.size() > 1) {
            throw new RuntimeException("Expected application " + application.applicationInstanceId() +
                    " to have exactly one storage node service on host " + hostName + " but got " +
                    storageNodesOnHost.size() + ": " + storageNodesOnHost);
        }

        return storageNodesOnHost.stream().findAny();
    }
@Test
    public void testGetStorageNodeAtHostWithUnknownHost() {
        Optional<ServiceInstance> service =
                VespaModelUtil.getStorageNodeAtHost(application, new HostName("storage-1"));
        assertFalse(service.isPresent());
    }