* @param step The increment to step.
* @return A stream using the given enumerator from the given value to the other given value stepping at the given
* increment.
*/
public static <A> Stream<A> range(final Enumerator<A> e, final A from, final A to, final long step) {
final Ordering o = e.order().compare(from, to);
return o == EQ || step > 0L && o == GT || step < 0L && o == LT ? single(from) : cons(from, new P1<Stream<A>>() {
public Stream<A> _1() {
return Stream.join(e.plus(from, step).filter(new F<A, Boolean>() {
public Boolean f(final A a) {
return !(o == LT ? e.order().isLessThan(to, a) : e.order().isGreaterThan(to, a));