What’s the shortest way to get an Iterator over a range of Integers in Java? In other words, implement the following:
/** * Returns an Iterator over the integers from first to first+count. */ Iterator<Integer> iterator(Integer first, Integer count);
Something like
(first..first+count).iterator()
Straight-forward implementation of your homework: