code: public static <T, K, V> Map<K, V> toMap( Stream<T> stream, Function<T, K> keySupplier, Function<T, V> valueSupplier ) {
          return stream.collect(Collectors.toMap(keySupplier, valueSupplier));
      }
docs: Collect stream to map.
  
  @param stream the stream to convert.
  @param keySupplier the supplier for the key, ex. Object::getId()
  @param valueSupplier the value supplier, ex. Object::getValue()
  @return the map.