code: public static <K, V> Map<K, List<V>> group(Collection<V> collection, Function<V, K> keyFn) {
          Map<K, List<V>> map = new HashMap<>();
  
          for (V value : collection) {
              K key = keyFn.apply(value);
  
              if (map.get(key) == null) {
                  map.put(key, new ArrayList<V>());
              }
  
              map.get(key).add(value);
          }
  
          return map;
      }
docs: Does a "group by" or map aggregation on a collection based on keys that are emitted by the given function. For
  each key emitted by the function, the map will contain a list at that key entry containing at least one element
  from the collection.
  
  @param collection the collection to group
  @param keyFn the function that emits the key for each value
  @param <K> the key type
  @param <V> the value type
  @return a map of lists where each list contains elements that