@Override
    public int compareTo(StorageNode otherStorageNode) {
        if (!(otherStorageNode instanceof StorageNodeImpl that)) {
            throw new IllegalArgumentException("Unable to compare our class to any StorageNode object");
        }

        // We're guaranteed there's only one storage service per node.
        return this.storageService.hostName().compareTo(that.storageService.hostName());
    }
Only base it on the service instance, e.g. the cluster ID is included in its equals().
orchestrator/src/main/java/com/yahoo/vespa/orchestrator/model/StorageNodeImpl.java