/ Comparable implementation
334927
public int compareTo(final Rational pOther) {
        double thisVal = doubleValue();
        double otherVal = pOther.doubleValue();

        return thisVal < otherVal ? -1 : thisVal == otherVal ? 0 : 1;
    }
1017584
@Override
  public int compareTo(final SysEvent val) {
    if (val == null) {
      return 1;
    }
    return (sysCode.compareTo(val.sysCode));
  }
319941
@SuppressWarnings("unchecked")
    final int compare(Object k1, Object k2) {
        return comparator==null ? ((Comparable<? super K>)k1).compareTo((K)k2)
            : comparator.compare((K)k1, (K)k2);
    }
887538
@Override
	public int compareTo(ValueArray<NullValue> o) {
		NullValueArray other = (NullValueArray) o;

		return Integer.compare(position, other.position);
	}
1090049
@Override
    public int compareTo(Object o) {
        HashCalculationResult myClass = (HashCalculationResult) o;
        return new CompareToBuilder()
                .append(this.fullHash, myClass.fullHash)
                .append(this.mostSigBitsHash, myClass.mostSigBitsHash)
                .append(this.leastSigBitsHash, myClass.leastSigBitsHash)
                .toComparison();
    }
238228
@Override
	public int compareTo(ValueArray<FloatValue> o) {
		FloatValueArray other = (FloatValueArray) o;

		int min = Math.min(position, other.position);
		for (int i = 0; i < min; i++) {
			int cmp = Float.compare(data[i], other.data[i]);

			if (cmp != 0) {
				return cmp;
			}
		}

		return Integer.compare(position, other.position);
	}
1227295
@SuppressWarnings({"rawtypes","unchecked"}) // for cast to Comparable
    static int compareComparables(Class<?> kc, Object k, Object x) {
        return (x == null || x.getClass() != kc ? 0 :
                ((Comparable)k).compareTo(x));
    }
1066086
@Pure
	@Override
	@SuppressWarnings({"unchecked", "checkstyle:npathcomplexity"})
	public int compareTo(Object obj) {
		final Object oth = (obj instanceof Reference) ? ((Reference<?>) obj).get() : obj;
		final T cur = get();

		if (oth == null && cur == null) {
			return 0;
		}
		if (cur == null) {
			return 1;
		}
		if (oth == null) {
			return -1;
		}

		if (cur instanceof Comparable) {
			try {
				return ((Comparable<Object>) cur).compareTo(oth);
			} catch (AssertionError e) {
				throw e;
			} catch (Throwable exception) {
				//
			}
		}

		if (oth instanceof Comparable) {
			try {
				return -((Comparable<Object>) oth).compareTo(cur);
			} catch (AssertionError e) {
				throw e;
			} catch (Throwable exception) {
				//
			}
		}

		return oth.hashCode() - cur.hashCode();
	}
968210
@Override
    public int compareTo(final MutableByte other) {
        return (this.value > other.value) ? 1 : ((this.value == other.value) ? 0 : -1);
    }
648711
@Override
    public int compareTo(final MethodInfo other) {
        final int diff0 = declaringClassName.compareTo(other.declaringClassName);
        if (diff0 != 0) {
            return diff0;
        }
        final int diff1 = name.compareTo(other.name);
        if (diff1 != 0) {
            return diff1;
        }
        return typeDescriptorStr.compareTo(other.typeDescriptorStr);
    }
1226163
def equal(obj1, obj2):
    """"""
    Comparable.log(obj1, obj2, '==')
    equality = obj1.equality(obj2)
    Comparable.log(obj1, obj2, '==', result=equality)
    return equality
1087361
public static <T extends Comparable<T>> int checkCompare(T a, T b) {
        return a == null ?
                b == null ? 0 : -1 :
                    b == null ? 1 : a.compareTo(b);
      }
927948
@Override
	public int compareTo(ShortValue o) {
		final int other = o.value;
		return this.value < other ? -1 : this.value > other ? 1 : 0;
	}
382927
private int compare(Object key1, Object key2) {
        if (comparator == null)
            return ((Comparable) key1).compareTo(key2);
        else
            return comparator.compare(key1, key2);
    }
212696
public static <T extends Comparable<T>> T leq(T value) {
        reportMatcher(new LessOrEqual<T>(value));
        return null;
    }
1352210
def comparable(self):
    """"""
    string_parts = []

    if self.location is not None:
      string_parts.append('location: {0:s}'.format(self.location))
    if self.part_index is not None:
      string_parts.append('part index: {0:d}'.format(self.part_index))
    if self.start_offset is not None:
      string_parts.append('start offset: 0x{0:08x}'.format(self.start_offset))

    return self._GetComparable(sub_comparable_string=', '.join(string_parts))
379828
public static <T extends Comparable<T>> Integer[] arsort(T[] array) {
        return _asort(array, true);
    }