@SuppressWarnings("unchecked")
	@Override
	public final int compareTo(Pair<F, S> other) {
		int result;
		if (mFirst instanceof Comparable) {
			result = ((Comparable<F>) mFirst).compareTo(other.mFirst);
		} else {
			result = Numbers.compare(mFirst.hashCode(), other.mFirst.hashCode());
		}
		if (result == 0) {
			if (mSecond instanceof Comparable) {
				result = ((Comparable<S>) mSecond).compareTo(other.mSecond);
			} else {
				result = Numbers.compare(mSecond.hashCode(), other.mSecond.hashCode());
			}
		}
		return result;
	}