Here you can find the source of rangeCheck(final C start, final C end, final C step)
static <C extends Number & Comparable<C>> void rangeCheck(final C start, final C end, final C step)
//package com.java2s; //License from project: Open Source License public class Main { static <C extends Number & Comparable<C>> void rangeCheck(final C start, final C end, final C step) { if (step.doubleValue() == 0) { throw new IllegalArgumentException("step is 0."); }/*w w w .j a v a 2 s. co m*/ if (start.compareTo(end) < 0 && step.doubleValue() < 0) { throw new IllegalArgumentException("start < end, but step is negative"); } } }