code: @Override
  	public int compareTo(ResidueNumber other) {
  
  		// chain id
  		if (chainName != null && other.chainName != null) {
  			if (!chainName.equals(other.chainName)) return chainName.compareTo(other.chainName);
  		}
  		if (chainName != null && other.chainName == null) {
  			return 1;
  		} else if (chainName == null && other.chainName != null) {
  			return -1;
  		}
  
  		return compareToPositional(other);
  	}
docs: Compare residue numbers by chain, sequence number, and insertion code