` public static IEnumerable<U> GroupByMissing<T, U>(this IEnumerable<T> inputs, Func<T, T> getIncr, Func<T, T, U> selector, Func<T, T, int> comparisonFunc)
{
var initialized = false;
T first = default(T);
T last = default(T);
T next = default(T);
Tuple<T, T> tuple = null;
foreach (var input in inputs)
{
if (!initialized)
{
first = input;
last = input;
initialized = true;
continue;
}
if (comparisonFunc(last, input) < 0)
{
throw new ArgumentException(string.Format("Values are not monotonically increasing. {0} should be less than {1}", last, input));