private int compare(ComponentId n1, ComponentId n2) {
        if (n1 == null && n2 == null)
            return 0;
        if (n1 == null)
            return -1;
        if (n2 == null)
            return 1;

        return n1.compareTo(n2);
    }
Code common to ComponentId and ComponentSpecification

@author Tony Vaagenes
component/src/main/java/com/yahoo/component/Spec.java