private static long end ( Range < Long > range ) { if ( range . upperBoundType ( ) == BoundType . OPEN ) { return DiscreteDomain . longs ( ) . previous ( range . upperEndpoint ( ) ) ; } else { return range . upperEndpoint ( ) ; } }
Get the end of the range . Always use this method to get the end of a range because it respects the bound type .