code: public final <K, V, M extends Map<K, V>> M toMap(
              final Function<? super T, ? extends K> keyFunction,
              final Function<? super T, ? extends V> valueFunction, final M map) {
          Preconditions.checkNotNull(keyFunction);
          Preconditions.checkNotNull(valueFunction);
          Preconditions.checkNotNull(map);
          toHandler(new Handler<T>() {
  
              @Override
              public void handle(final T element) {
                  if (element != null) {
                      final K key = keyFunction.apply(element);
                      final V value = valueFunction.apply(element);
                      if (key != null && value != null) {
                          map.put(key, value);
                      }
                  }
              }
  
          });
          return map;
      }
docs: Terminal operation storing the elements of this Stream in the supplied map as
  {@code <key, value>} pairs computed using the supplied Functions. The supplied key and
  value Functions are called for each element, producing the keys and values to store in the
  Map. If a null key or value are produced, the element is discarded. If multiple values are
  mapped to the same key, only the most recently computed one will be stored. Use
  {@link Functions#identity()} in case no transformation is required to extract the key
  and/or the value.
  
  @param keyFunction
  the key function
  @param valueFunction
  the value function
  @param map
  the Map where to store the extracted {@code <key, value>} pairs
  @param <K>
  the type of key
  @param <V>
  the type of value
  @param <M>
  the type of Map
  @return the supplied Map