GROOVY-9649: Sonar refactoring
GROOVY-9649: Sonar refactoring

- NumberRange: Extracted nested ternary operations of hasNext into independent statements
- NumberRange: Inverted if-condition in fetchNextIfNeeded to reduce its cognitive complexity

apache/incubator-groovy,apache/groovy,apache/groovy,apache/incubator-groovy,apache/groovy,apache/incubator-groovy,paulk-asert/groovy,apache/groovy,paulk-asert/groovy,paulk-asert/groovy,apache/incubator-groovy,paulk-asert/groovy