result = ahead ? Long.MIN_VALUE : 0;
else
result = ahead ? 0 : Long.MAX_VALUE;
while (i.hasNext()) {
assignment = (Assignment)i.next();
long offsetDate = assignment.calcOffsetFrom(startDate,dependencyDate,ahead,remainingOnly,useSooner);
result = ahead ? Math.max(result,offsetDate) : Math.min(result,offsetDate);
}
return result;
}