We include this, but don't derive from Comparator<Name> to avoid a dependency on Java 5.
14269
static public int compare(Name n1, Name n2) {
    int ret = n1.namespaceUri.compareTo(n2.namespaceUri);
    if (ret != 0)
      return ret;
    return n1.localName.compareTo(n2.localName);
  }
121760
public static ComparatorItem fromSort(Sort sort) {
    if (sort == null) {
      return null;
    }
    ComparatorItem comparatorItem = null;
    for (Order order : sort) {
      ComparatorItem item = fromSortOrder(order);
      if (item != null) {
        if (comparatorItem == null) {
          comparatorItem = item;
        } else {
          comparatorItem.getLastComparatorItem().setNextComparatorItem(item);
        }
      }
    }
    return comparatorItem;
  }
550957
public static Class<?> classForName(String name) throws ClassNotFoundException {
        if ("void".equals(name)) return void.class;
        if ("char".equals(name)) return char.class;
        if ("boolean".equals(name)) return boolean.class;
        if ("byte".equals(name)) return byte.class;
        if ("short".equals(name)) return short.class;
        if ("int".equals(name)) return int.class;
        if ("long".equals(name)) return long.class;
        if ("float".equals(name)) return float.class;
        if ("double".equals(name)) return double.class;
        return Class.forName(name, true, Thread.currentThread().getContextClassLoader());
    }
388268
public static <T extends List<U>, U extends Comparable<U>> Comparator<T> canonicalComparator() {
        return CmpUtil::canonicalCompare;
    }
235123
@Override
    public int compareTo(Reference o) {
        return new CompareToBuilder()
                .append(source, o.source)
                .append(name, o.name)
                .append(url, o.url)
                .toComparison();
    }
208844
@Override
    public <T extends GraphQLType> Comparator<? super T> getComparator(SchemaPrinterComparatorEnvironment environment) {
        Comparator<?> comparator = registry.get(environment);
        if (comparator != null) {
            //noinspection unchecked
            return (Comparator<? super T>) comparator;
        }
        comparator = registry.get(environment.transform(builder -> builder.parentType(null)));
        if (comparator != null) {
            //noinspection unchecked
            return (Comparator<? super T>) comparator;
        }
        return DEFAULT_COMPARATOR;
    }
367784
public static void doSetAscRecursively(ComparatorItem comparatorItem, boolean asc) {
    ComparatorItem tmp = comparatorItem;
    while (tmp != null) {
      tmp.setAsc(asc);
      tmp = tmp.getNextComparatorItem();
    }
  }
80629
static ConfigObject includeWithoutFallback(final ConfigIncludeContext context, String name) {
        // the heuristic is valid URL then URL, else relative to including file;
        // relativeTo in a file falls back to classpath inside relativeTo().

        URL url;
        try {
            url = new URL(name);
        } catch (MalformedURLException e) {
            url = null;
        }

        if (url != null) {
            return includeURLWithoutFallback(context, url);
        } else {
            NameSource source = new RelativeNameSource(context);
            return fromBasename(source, name, context.parseOptions());
        }
    }
1050385
private void initComparators() {
		TupleMRConfigBuilder.initializeComparators(context.getHadoopContext()
		    .getConfiguration(), tupleMRConfig);
		customComparators = new RawComparator<?>[maxDepth + 1];
		for(int i = minDepth; i <= maxDepth; i++) {
			SortElement element = tupleMRConfig.getCommonCriteria().getElements().get(i);
			if(element.getCustomComparator() != null) {
				customComparators[i] = element.getCustomComparator();
			}
		}
	}
497860
public int compareTo(NameValuePair<T> other) {
        String otherName = other.mName;

        if (mName == null) {
            return otherName == null ? 0 : 1;
        }

        if (otherName == null) {
            return -1;
        }

        return mName.compareToIgnoreCase(otherName);
    }
431549
private static final <T extends Tuple, K> TypeComparator<T> createLeadingFieldComparator(boolean ascending, TypeInformation<?> info) {
		if (!(info.isKeyType() && info instanceof AtomicType)) {
			throw new IllegalArgumentException("The field at position 0 (" + info + ") is no atomic key type.");
		}
		
		@SuppressWarnings("unchecked")
		AtomicType<K> typedInfo = (AtomicType<K>) info;
		return new TupleLeadingFieldComparator<T, K>(typedInfo.createComparator(ascending));
	}
1014579
private void moveMethods(Collection<NameInfo> allNameInfo) {
    boolean hasStubDeclaration = idGenerator.hasGeneratedAnyIds();
    for (NameInfo nameInfo : allNameInfo) {
      if (!nameInfo.isReferenced()) {
        // The code below can't do anything with unreferenced name
        // infos.  They should be skipped to avoid NPE since their
        // deepestCommonModuleRef is null.
        continue;
      }

      if (nameInfo.readsClosureVariables()) {
        continue;
      }

      JSModule deepestCommonModuleRef = nameInfo.getDeepestCommonModuleRef();
      if (deepestCommonModuleRef == null) {
        compiler.report(JSError.make(NULL_COMMON_MODULE_ERROR));
        continue;
      }

      Iterator<Symbol> declarations =
          nameInfo.getDeclarations().descendingIterator();
      while (declarations.hasNext()) {
        Symbol symbol = declarations.next();
        if (symbol instanceof PrototypeProperty) {
          tryToMovePrototypeMethod(nameInfo, deepestCommonModuleRef, (PrototypeProperty) symbol);
        } else if (symbol instanceof ClassMemberFunction) {
          tryToMoveMemberFunction(nameInfo, deepestCommonModuleRef, (ClassMemberFunction) symbol);
        } // else it's a variable definition, and we don't move those.
      }
    }

    if (!noStubFunctions && !hasStubDeclaration && idGenerator
        .hasGeneratedAnyIds()) {
      // Declare stub functions in the top-most chunk.
      Node declarations = compiler.parseSyntheticCode(STUB_DECLARATIONS);
      NodeUtil.markNewScopesChanged(declarations, compiler);
      Node firstScript = compiler.getNodeForCodeInsertion(null);
      firstScript.addChildrenToFront(declarations.removeChildren());
      compiler.reportChangeToEnclosingScope(firstScript);
    }
  }
352462
public boolean isSameOrNewerThan(JavaVersion other) {
        return this.major > other.major || (this.major == other.major && this.minor >= other.minor);
    }
743394
public static <T1 extends Comparable<T1>, T2 extends Comparable<T2>> Comparator<Pair<T1, T2>> naturalOrder() {
        return new Comparator<Pair<T1,T2>>() {

            @Override
            public int compare(Pair<T1, T2> lhs, Pair<T1, T2> rhs) {
                return compareTo(lhs, rhs);
            }

        };
	}
991601
public static <T> Collector<T, ?, Seq<T>> minAll(Comparator<? super T> comparator) {
        return minAllBy(t -> t, comparator);
    }
159379
private boolean isIncluded(String className) {
    if (includes == null || includes.size() == 0) {
      // generate nothing if no include defined - it makes no sense to generate for all classes from classpath
      return false;
    }
    return includes.stream()
        .filter(pattern -> SelectorUtils.matchPath(pattern, className, ".", true))
        .count() > 0;
  }
1170949
public int compareTo(Object obj) {
		DistinguishedName that = (DistinguishedName) obj;
		ListComparator comparator = new ListComparator();
		return comparator.compare(this.names, that.names);
	}