Github user paulk-asert commented on a diff in the pull request:
https://github.com/apache/groovy/pull/366#discussion_r70927754
--- Diff: src/main/groovy/lang/NumberRange.java ---
@@ -0,0 +1,536 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+package groovy.lang;
+
+import org.codehaus.groovy.runtime.InvokerHelper;
+import org.codehaus.groovy.runtime.IteratorClosureAdapter;
+
+import java.math.BigDecimal;
+import java.math.BigInteger;
+import java.util.AbstractList;
+import java.util.Iterator;
+import java.util.List;
+
+import static
org.codehaus.groovy.runtime.ScriptBytecodeAdapter.compareEqual;
+import static
org.codehaus.groovy.runtime.ScriptBytecodeAdapter.compareGreaterThan;
+import static
org.codehaus.groovy.runtime.ScriptBytecodeAdapter.compareGreaterThanEqual;
+import static
org.codehaus.groovy.runtime.ScriptBytecodeAdapter.compareLessThan;
+import static
org.codehaus.groovy.runtime.ScriptBytecodeAdapter.compareLessThanEqual;
+import static
org.codehaus.groovy.runtime.ScriptBytecodeAdapter.compareNotEqual;
+import static org.codehaus.groovy.runtime.ScriptBytecodeAdapter.compareTo;
+import static org.codehaus.groovy.runtime.dgmimpl.NumberNumberMinus.minus;
+import static org.codehaus.groovy.runtime.dgmimpl.NumberNumberPlus.plus;
+import static
org.codehaus.groovy.runtime.dgmimpl.NumberNumberMultiply.multiply;
+
+/**
+ * Represents an inclusive list of Numbers from a value to a value with a
particular step size.
+ */
+public class NumberRange extends AbstractList implements
Range {
+
+/**
+ * The first value in the range.
+ */
+private final Comparable from;
+
+/**
+ * The last value in the range.
+ */
+private final Comparable to;
+
+/**
+ * The step size in the range.
+ */
+private final Number stepSize;
+
+/**
+ * The cached size, or -1 if not yet computed
+ */
+private int size = -1;
+
+/**
+ * true if the range counts backwards from
to to from.
+ */
+private final boolean reverse;
+
+/**
+ * true if the range includes the upper bound.
+ */
+private final boolean inclusive;
+
+/**
+ * Creates an inclusive {@link NumberRange} with step size 1.
+ * Creates a reversed range if from to.
+ *
+ * @param from the first value in the range
+ * @param to the last value in the range
+ */
+public
+NumberRange(T from, U to) {
+this(from, to, null, true);
+}
+
+/**
+ * Creates a new {@link NumberRange} with step size 1.
+ * Creates a reversed range if from to.
+ *
+ * @param from start of the range
+ * @param to end of the range
+ * @param inclusive whether the range is inclusive
+ */
+public
+NumberRange(T from, U to, boolean inclusive) {
+this(from, to, null, inclusive);
+}
+
+/**
+ * Creates an inclusive {@link NumberRange}.
+ * Creates a reversed range if from to.
+ *
+ * @param from start of the range
+ * @param to end of the range
+ * @param stepSize the gap between discrete elements in the range
+ */
+public >
+NumberRange(T from, U to, V stepSize) {
+this(from, to, stepSize, true);
+}
+
+/**
+ * Creates a {@link NumberRange}.
+ * Creates a reversed range if from to.
+ *
+ * @param from start of the range
+ * @param to end of the range
+ * @param stepSize the gap between discrete elements in the range
+ * @param inclusive whether the range is inclusive
+ */
+public
+NumberRange(T from, U to, V stepSize, boolean inclusive) {
+if (from == null) {
+throw new IllegalArgumentException("Must