public static < T > Iterable < T > distinct ( final Iterable < T > iterable ) { requireNonNull ( iterable ) ; return ( ) -> Iterators2 . distinct ( iterable . iterator ( ) ) ; }
If we can assume the iterable is sorted return the distinct elements . This only works if the data provided is sorted .