nl_tokens: Returns the minimal range that { @linkplain Range#contains ( Comparable ) contains } all of the given values . The returned range is { @linkplain BoundType#CLOSED closed } on both ends .
pl_tokens: public static < C extends Comparable < ? > > Range < C > encloseAll ( Iterable < C > values ) { checkNotNull ( values ) ; if ( values instanceof SortedSet ) { SortedSet < ? extends C > set = cast ( values ) ; Comparator < ? > comparator = set . comparator ( ) ; if ( Ordering . natural ( ) . equals ( comparator ) || comparator == null ) { return closed ( set . first ( ) , set . last ( ) ) ; } } Iterator < C > valueIterator = values . iterator ( ) ; C <mask> = checkNotNull ( valueIterator . next ( ) ) ; C max = min ; while ( valueIterator . hasNext ( ) ) { C value = checkNotNull ( valueIterator . next ( ) ) ; min = Ordering . natural ( ) . min ( min , value ) ; max = Ordering . natural ( ) . max ( max , value ) ; } return closed ( min , max ) ; }