@SuppressWarnings("unchecked")
	public static <TSource, Value> Comparable<Value> max(Iterable<TSource> iterable, Func1<Comparable<Value>, TSource> selector) {
		Comparable<Value> maxVal = null;
		for (TSource tSource : iterable) {
			Comparable<Value> comparableVal = selector.call(tSource);
			if (maxVal == null) maxVal = comparableVal;
			else if (maxVal.compareTo((Value) comparableVal) < 0) maxVal = comparableVal;
		}
		return maxVal;
	}