code: @CheckReturnValue
      @BackpressureSupport(BackpressureKind.UNBOUNDED_IN)
      @SchedulerSupport(SchedulerSupport.NONE)
      public final <K> Single<Map<K, T>> toMap(final Function<? super T, ? extends K> keySelector) {
          ObjectHelper.requireNonNull(keySelector, "keySelector is null");
          return collect(HashMapSupplier.<K, T>asCallable(), Functions.toMapKeySelector(keySelector));
      }
docs: Returns a Single that emits a single HashMap containing all items emitted by the finite source Publisher,
  mapped by the keys returned by a specified {@code keySelector} function.
  <p>
  <img width="640" height="305" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/toMap.png" alt="">
  <p>
  If more than one source item maps to the same key, the HashMap will contain the latest of those items.
  <p>
  Note that this operator requires the upstream to signal {@code onComplete} for the accumulated map to
  be emitted. Sources that are infinite and never complete will never emit anything through this
  operator and an infinite source may lead to a fatal {@code OutOfMemoryError}.
  <dl>
  <dt><b>Backpressure:</b></dt>
  <dd>The operator honors backpressure from downstream and consumes the source {@code Publisher} in an
  unbounded manner (i.e., without applying backpressure to it).</dd>
  <dt><b>Scheduler:</b></dt>
  <dd>{@code toMap} does not operate by default on a particular {@link Scheduler}.</dd>
  </dl>
  
  @param <K> the key type of the Map
  @param keySelector
  the function that extracts the key from a source item to be used in the HashMap
  @return a Single that emits a single item: a HashMap containing the mapped items from the source
  Publisher
  @see <a href="http://reactivex.io/documentation/operators/to.html">ReactiveX operators documentation: To</a>