Used to sort two CDSSequences where Negative Strand makes it tough
@param o1
@param o2
@return val
175383
@Override
		public int compare(CDSSequence o1, CDSSequence o2) {
			if(o1.getStrand() != o2.getStrand()){
				return o1.getBioBegin() - o2.getBioBegin();
			}
			if(o1.getStrand() == Strand.NEGATIVE){
				return -1 * (o1.getBioBegin() - o2.getBioBegin());
			}

			return o1.getBioBegin() - o2.getBioBegin();
		}
621112
public int compare(Object o1, Object o2) {
		List list1 = (List) o1;
		List list2 = (List) o2;

		for (int i = 0; i < list1.size(); i++) {
			if (list2.size() > i) {
				Comparable component1 = (Comparable) list1.get(i);
				Comparable component2 = (Comparable) list2.get(i);
				int componentsCompared = component1.compareTo(component2);
				if (componentsCompared != 0) {
					return componentsCompared;
				}
			}
			else {
				// First instance has more components, so that instance is
				// greater.
				return 1;
			}
		}

		// All components so far are equal - if the other instance has
		// more components it is greater otherwise they are equal.
		if (list2.size() > list1.size()) {
			return -1;
		}
		else {
			return 0;
		}
	}
1239023
protected  static String[] sortDescending(String[] s) {
        Arrays.sort(s,
                    new Comparator<String>() {
            @Override
            public int compare(String o1, String o2) {
                if (o1.length() < o2.length())
                    return 1;
                if (o1.length() > o2.length())
                    return -1;
                return 0;
            }
        }
        );
        return s;
    }
89538
public static <O> boolean eq( O o1, O o2 )
    {
        return o1 != null ? o1.equals( o2 ) : o2 == null;
    }
1203719
@Override
    public int compare(Integer o1, Integer o2) {
        double diff = dataArray[o2] - dataArray[o1];
        if (diff == 0) {
            return 0;
        }
        if (sortType == ASCENDING) {
            return (diff > 0) ? -1 : 1;
        } else {
            return (diff > 0) ? 1 : -1;
        }
    }
766587
@Override
	public int compareTo(ValueArray<StringValue> o) {
		StringValueArray other = (StringValueArray) o;

		// sorts first on number of data in the array, then comparison between
		// the first non-equal element in the arrays
		int cmp = Integer.compare(position, other.position);

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

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

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

		return 0;
	}
719272
public int compareTo(Object o) {
    long thisValue = this.value;
    long thatValue = ((LongWritable)o).value;
    return (thisValue<thatValue ? -1 : (thisValue==thatValue ? 0 : 1));
  }
757828
public static int compare(CharSequence s1, CharSequence s2, IntUnaryOperator op)
    {
        return Streams.compare(s1.codePoints().map(op), s2.codePoints().map(op));
    }
262942
public static boolean match(SkippableIterator o1, SkippableIterator o2) {
		while (o1.getCurrentWordOffset() != o2.getCurrentWordOffset()) {
			if (o1.getCurrentWordOffset() < o2.getCurrentWordOffset()) {
				o1.advanceUntil(o2.getCurrentWordOffset());
				if (!o1.hasValue())
					return false;
			}
			if (o1.getCurrentWordOffset() > o2.getCurrentWordOffset()) {
				o2.advanceUntil(o1.getCurrentWordOffset());
				if (!o2.hasValue())
					return false;
			}
		}
		return true;
	}
1322692
@SuppressWarnings("unchecked")
   public static int compare(Object o1, Object o2) {
      if (o1 == null && o2 == null) {
         return 0;
      } else if (o1 == null) {
         return 1;
      } else if (o2 == null) {
         return -1;
      }
      return Cast.<Comparable>as(o1).compareTo(o2);
   }
737086
public static int inconsistentCompare(MimeType o1, MimeType o2) {
        if ((o1 == null) && (o2 == null)) {
            return 0;
        }
        if (o1 == null) {
            return 1;
        }
        if (o2 == null) {
            return -1;
        }
        int wilchCharComparison = compareByWildCardCount(o1, o2);
        if (wilchCharComparison == 0) {
            float q1 = getQ(o1);
            float q2 = getQ(o2);
            if (q1 == q2) {
                return fallBackCompare(o1, o2);
            }
            if (q1 > q2) {
                return -1;
            } else {
                return 1;
            }
        } else {
            return wilchCharComparison;
        }
    }
180330
public static <T> SerializableComparator<T> hashCodeComparator() {
      return (o1, o2) -> {
         if (o1 == o2) {
            return 0;
         } else if (o1 == null) {
            return 1;
         } else if (o2 == null) {
            return -1;
         }
         return Integer.compare(o1.hashCode(), o2.hashCode());
      };
   }
1282823
public int compareTo(Object o) {
    int thisValue = this.value;
    int thatValue = ((ByteWritable)o).value;
    return (thisValue < thatValue ? -1 : (thisValue == thatValue ? 0 : 1));
  }
1102079
@Override
    public int compare(
        ChronoInterval<T> o1,
        ChronoInterval<T> o2
    ) {

        Boundary<T> bs1 = o1.getStart();
        Boundary<T> bs2 = o2.getStart();

        if (bs1.isInfinite()) {
            if (bs2.isInfinite()) {
                return this.compareEnd(o1, o2);
            } else {
                return -1;
            }
        } else if (bs2.isInfinite()) {
            return 1;
        }

        T start1 = bs1.getTemporal();
        T start2 = bs2.getTemporal();

        if (bs1.isOpen()) {
            start1 = this.axis.stepForward(start1);
        }
        if (bs2.isOpen()) {
            start2 = this.axis.stepForward(start2);
        }

        // open max condition (rare edge case)
        if (start1 == null) {
            if (start2 == null) {
                return 0;
            } else {
                return 1;
            }
        } else if (start2 == null) {
            return -1;
        }

        int delta = this.axis.compare(start1, start2);

        if (delta == 0) {
            delta = this.compareEnd(o1, o2);
        }

        return delta;

    }
373050
public static boolean areEqual(Object o1, Object o2) {
        return
            !o1.getClass().isArray() ? o1.equals(o2) :
                o1.getClass() == boolean[].class ? Arrays.equals((boolean[]) o1, (boolean[]) o2) :
                    o1.getClass() == byte[].class ? Arrays.equals((byte[]) o1, (byte[]) o2) :
                        o1.getClass() == char[].class ? Arrays.equals((char[]) o1, (char[]) o2) :
                            o1.getClass() == double[].class ? Arrays.equals(
                                (double[]) o1,
                                (double[]) o2
                            ) :
                                o1.getClass() == float[].class ? Arrays.equals(
                                    (float[]) o1,
                                    (float[]) o2
                                ) :
                                    o1.getClass() == int[].class ? Arrays.equals(
                                        (int[]) o1,
                                        (int[]) o2
                                    ) :
                                        o1.getClass() == long[].class ? Arrays.equals(
                                            (long[]) o1,
                                            (long[]) o2
                                        ) :
                                            o1.getClass() == short[].class ? Arrays.equals(
                                                (short[]) o1,
                                                (short[]) o2
                                            ) :
                                                Arrays.equals(
                                                    (Object[]) o1,
                                                    (Object[]) o2
                                                );
    }
414393
@Override
    public int compare(File o1, File o2) {
        return -1 * new Long(o1.lastModified()).compareTo(new Long(o2.lastModified()));
    }
1053382
public static function lengthSort($val_1, $val_2)
    {
        // initialize the return value to zero
        $retVal = 0;

        // compare lengths
        $firstVal = strlen($val_1);
        $secondVal = strlen($val_2);

        if ($firstVal > $secondVal) {
            $retVal = 1;
        } elseif ($firstVal < $secondVal) {
            $retVal = -1;
        }

        return $retVal;
    }