@Override
        public int compare(NodeResources a, NodeResources b) {
            if (a.memoryGiB() > b.memoryGiB()) return 1;
            if (a.memoryGiB() < b.memoryGiB()) return -1;
            if (a.diskGb() > b.diskGb()) return 1;
            if (a.diskGb() < b.diskGb()) return -1;
            if (a.vcpu() > b.vcpu()) return 1;
            if (a.vcpu() < b.vcpu()) return -1;

            int storageTypeComparison = NodeResources.StorageType.compare(a.storageType(), b.storageType());
            if (storageTypeComparison != 0) return storageTypeComparison;

            return compare(a.diskSpeed(), b.diskSpeed());
        }
Returns a comparator comparing by memory, disk, vcpu
node-repository/src/main/java/com/yahoo/vespa/hosted/provision/provisioning/NodeResourceComparator.java