public static boolean isValid ( Range range ) { if ( range == null ) { return false ; } double min = range . getMinimum ( ) . doubleValue ( ) ; double max = range . getMaximum ( ) . doubleValue ( ) ; return min != max && ! Double . isNaN ( min ) && ! Double . isInfinite ( min ) && ! Double . isNaN ( max ) && ! Double . isInfinite ( max ) ; }
Checks whether the range is of non - zero size and the boundaries are neither NaN or Infinity .