code: public static long length(final Range<Long> range) {
          checkClosedOpen(range);
          return Math.max(0L, range.upperEndpoint() - range.lowerEndpoint());
      }
docs: Return the length of the specified range.
  
  @param range range, must not be null and must be [closed, open)
  @return the length of the specified range