public static < K , V > Map < K , V > fromIterables ( Iterable < ? extends K > iterable0 , Iterable < ? extends V > iterable1 ) { Map < K , V > map = new LinkedHashMap < K , V > ( ) ; Iterator < ? extends K > i0 = iterable0 . iterator ( ) ; Iterator < ? extends V > i1 = iterable1 . iterator ( ) ; while ( i0 . hasNext ( ) && i1 . hasNext ( ) ) { K k = i0 . next ( ) ; V v = i1 . next ( ) ; map . put ( k , v ) ; } return map ; }
Creates a map that maps the elements of the first sequence to the corresponding elements in the second sequence . If the given sequences have different lengths then only the elements of the shorter sequence will be contained in the map .