/* Collections - Decompiled by JODE
 * Visit http://jode.sourceforge.net/
 */
package salvo.jesus.util;
import java.util.Collection;
import java.util.Comparator;
import java.util.HashSet;
import java.util.Iterator;
import java.util.Set;

public class Collections
{
    public static Set subset(Collection collection, Object object,
			     Comparator comparator) {
	HashSet hashset = new HashSet();
	Iterator iterator = collection.iterator();
	while (iterator.hasNext()) {
	    Object object_0_ = iterator.next();
	    if (comparator.compare(object, object_0_) == 0)
		collection.add(object_0_);
	}
	return hashset;
    }
    
    public static Object contains(Collection collection, Object object,
				  Comparator comparator) {
	HashSet hashset = new HashSet();
	Iterator iterator = collection.iterator();
	while (iterator.hasNext()) {
	    Object object_1_ = iterator.next();
	    if (comparator.compare(object, object_1_) == 0)
		return object_1_;
	}
	return null;
    }
}
