Turning Java enums into Groovy ranges

It turns out that it’s easy to turn a Java enum into a type that can be used in a Groovy range. Consider a simple enum representing the seasons: public enum Season { WINTER, SPRING, SUMMER FALL } Since enums implement the Comparable interface, they have a compareTo() method. Despite that, however, you can’t use… Read More