Here you can find the source of isEqual(Collection extends T> coll, Comparator super T> comp)
public static <T extends Object> boolean isEqual(Collection<? extends T> coll, Comparator<? super T> comp)
//package com.java2s; //License from project: Open Source License import java.util.Collection; import java.util.Comparator; import java.util.Iterator; public class Main { public static <T extends Object> boolean isEqual(Collection<? extends T> coll, Comparator<? super T> comp) { Iterator<? extends T> i = coll.iterator(); T first = i.next();/*from ww w .j ava 2 s. c om*/ while (i.hasNext()) { T next = i.next(); if (comp.compare(first, next) < 0) { return false; } } return true; } }