public int compareTo(BasicEditable other) { if (zOrder == other.getZOrder()) { return this.hashCode() - other.hashCode(); } return zOrder - other.getZOrder(); }