int (Version other) { int minSize = Math.min(myIntComponents.size(), other.myIntComponents.size()); for (int i = 0; i < minSize; i++) { int thisN = myIntComponents.getInt(i); int otherN = other.myIntComponents.getInt(i); if (thisN != otherN) { return thisN - otherN; } } if (myIntComponents.size() != other.myIntComponents.size()) { return myIntComponents.size() - other.myIntComponents.size(); } int labelCompare = myLabel.compareTo(other.myLabel); if (labelCompare != 0) { if (myLabel.isEmpty()) { return 1; } if (other.myLabel.isEmpty()) { return -1; } return labelCompare; } return myLabelVersion - other.myLabelVersion; }