This function returns the textual representation of a compare method (===, !==, <, >).

@param comparator defines a method to be used for comparisons (===, !==, <, >)
@returns the textual representation of the passed comparison method
513512
function comparatorStr(comparator) {
    if (comparator === Workflo.Comparator.ne) {
        return ' other than';
    }
    else if (comparator === Workflo.Comparator.gt) {
        return ' greater than';
    }
    else if (comparator === Workflo.Comparator.lt) {
        return ' less than';
    }
    else {
        return '';
    }
}
310478
@Override
    public CompareAssert withComparisonFormatter(ComparisonFormatter formatter) {
        this.formatter = formatter;
        diffBuilder.withComparisonFormatter(formatter);
        return this;
    }
390921
public static <T> T max(Iterator<T> self, Comparator<T> comparator) {
        return max((Iterable<T>)toList(self), comparator);
    }
1098868
public static <T> int compare(T a, T b, Comparator<? super T> c) {
        if (a == b) {
            return 0;
        }
        return c.compare(a, b);
    }
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));
    }
330815
@Pure
	public BusItineraryHalt getBusHalt(String name, Comparator<String> nameComparator) {
		if (name == null) {
			return null;
		}
		final Comparator<String> cmp = nameComparator == null ? BusNetworkUtilities.NAME_COMPARATOR : nameComparator;
		for (final BusItineraryHalt bushalt : this.validHalts) {
			if (cmp.compare(name, bushalt.getName()) == 0) {
				return bushalt;
			}
		}
		for (final BusItineraryHalt bushalt : this.invalidHalts) {
			if (cmp.compare(name, bushalt.getName()) == 0) {
				return bushalt;
			}
		}
		return null;
	}
905240
def _Comparator(self, operator):
    """"""
    if operator == "=":
      return lambda x, y: x == y
    elif operator == ">=":
      return lambda x, y: x >= y
    elif operator == ">":
      return lambda x, y: x > y
    elif operator == "<=":
      return lambda x, y: x <= y
    elif operator == "<":
      return lambda x, y: x < y
    elif operator == "!":
      return lambda x, y: x != y
    raise DefinitionError("Invalid comparison operator %s" % operator)
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);
      }
787198
public int compare(final T first, final T second) {
    int cmpRs = 0;
    for (final Comparator<T> com : comparators) {
      cmpRs = com.compare(first, second);
      if (0 == cmpRs) {
        continue;
      } else {
        break;
      }
    }
    return cmpRs;
  }
500572
public Comparator<Columns> comparator() {
        return new Comparator<Columns>() {
            public int compare(Columns o1, Columns o2) {

                if (o1 == null) {
                    return o2 == null ? 0 : 1;
                }
                if (o2 == null) {
                    return -1;
                }

                Column column1 = o1.getColumn(field);
                Column column2 = o2.getColumn(field);

                if (column1 == null) {
                    return column2 == null ? 0 : 1;
                }
                if (column2 == null) {
                    return -1;
                }

                AbstractType<?> type = column1.getType();
                ByteBuffer value1 = column1.getDecomposedValue();
                ByteBuffer value2 = column2.getDecomposedValue();
                return reverse ? type.compare(value2, value1) : type.compare(value1, value2);
            }
        };
    }
1032341
public int compare(String a, String b) {

        int i;

        if (collator == null) {
            i = a.compareTo(b);
        } else {
            i = collator.compare(a, b);
        }

        return (i == 0) ? 0
                        : (i < 0 ? -1
                                 : 1);
    }
696160
public Comparator<T> thenComparing(final java.util.Comparator<? super T> other) {
            final Comparator<T> me = this;
            return new Comparator<T>() {
                @Override
                public int compare(T o1, T o2) {
                    int ret = (me.compare(o1, o2));
                    return (0 == ret) ? other.compare(o1, o2) : ret;
                }
            };
        }
473851
public void addComparator(Comparator<T> comparator) {
		if (comparator instanceof InvertibleComparator) {
			this.comparators.add((InvertibleComparator<T>) comparator);
		}
		else {
			this.comparators.add(new InvertibleComparator<T>(comparator));
		}
	}
1259838
@Override
  public int compareTo(final Span s) {
    if (getStart() < s.getStart()) {
      return -1;
    } else if (getStart() == s.getStart()) {
      if (getEnd() > s.getEnd()) {
        return -1;
      } else if (getEnd() < s.getEnd()) {
        return 1;
      } else {
        // compare the type
        if (getType() == null && s.getType() == null) {
          return 0;
        } else if (getType() != null && s.getType() != null) {
          // use type lexicography order
          return getType().compareTo(s.getType());
        } else if (getType() != null) {
          return -1;
        }
        return 1;
      }
    } else {
      return 1;
    }
  }
671191
@NotNull
    public ComparatorCompat<T> thenComparing(@NotNull final Comparator<? super T> other) {
        return new ComparatorCompat<T>(thenComparing(comparator, other));
    }
544594
public static Comparator<Level> comparator() {
        return new Comparator<Level>() {
            @Override
            public int compare(Level l1, Level l2) {
                return Integer.compare(l1.intValue(), l2.intValue());
            }
        };
    }
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);
    }