Code example for Ordering

Methods: onResultOf

0
	 * Until {@link http://code.google.com/p/guava-libraries/issues/detail?id=332} is addressed. 
	 */ 
	public static <T> Ordering<T> explicitWithUnknownsFirst(List<T> valuesInOrder) {
		Function<T, T> unknownToNullFunction = new IdentityIndicatorFunction<T>(valuesInOrder);
 
		return Ordering.explicit(valuesInOrder).nullsFirst().onResultOf(unknownToNullFunction);
	} 
	 
	/** 
	 * {@link org.cishell.utilities.OrderingUtilities.explicitWithUnknownsFirst(List<T>)} 
	 */ 
	public static <T> Ordering<T> explicitWithUnknownsFirst(
			T leastValue, T... remainingValuesInOrder) {
		return explicitWithUnknownsFirst(Lists.asList(leastValue, remainingValuesInOrder));
	} 
	 
	 
	/** 
	 * Normally Ordering.explicit() gives an Ordering that throws a ClassCastException for 
	 * unspecified values.  This method gives an explicit ordering that puts unspecified values