code: public static <K, V> Map<K, V> asHashMap(List<V> list, ListExtractor<K, V> extractor) {
          if (list == null || extractor == null || list.isEmpty()) {
              return Collections.<K, V>emptyMap();
          }
          Map<K, V> map = new LinkedHashMap<>(list.size());
          for (V node : list) {
              map.put(extractor.extractKey(node), extractor.extractValue(node));
          }
          return map;
      }
docs: Convert a list into a {@link LinkedHashMap} using a {@link ListExtractor} to
  determine the keys and values for the new Map.
  
  @param <K> Type of list key
  @param <V> Type of list value
  @param list The list to convert
  @param extractor To determine key and value for each list entry
  @return A created {@link LinkedHashMap} or an empty map when one of the arguments
  is {@literal null}