@@ -1237,10 +1237,24 @@ public final A mode(final Ord<A> o) {
12371237 return sort (o ).group (o .equal ()).maximum (intOrd .comap (List .<A >length_ ())).head ();
12381238 }
12391239
1240+ /**
1241+ * Groups the elements of this list by a given keyFunction into a {@link HashMap}.
1242+ *
1243+ * @param keyFunction The function to select the keys for the map.
1244+ * @return A HashMap containing the keys with the accumulated list of matched elements.
1245+ */
12401246 public final <B > HashMap <B , List <A >> groupBy (final F <A , B > keyFunction ) {
12411247 return groupBy (keyFunction , Function .identity ());
12421248 }
12431249
1250+ /**
1251+ * Groups the elements of this list by a given keyFunction into a {@link HashMap} and transforms
1252+ * the matching elements with the given valueFunction.
1253+ *
1254+ * @param keyFunction The function to select the keys for the map.
1255+ * @param valueFunction The function to apply on each matching value.
1256+ * @return A HashMap containing the keys with the accumulated list of matched and mapped elements.
1257+ */
12441258 public final <B , C > HashMap <B , List <C >> groupBy (
12451259 final F <A , B > keyFunction ,
12461260 final F <A , C > valueFunction ) {
@@ -1253,6 +1267,18 @@ public List<C> f(final C head, final List<C> tail) {
12531267 });
12541268 }
12551269
1270+ /**
1271+ * Groups the elements of this list by a given keyFunction, applies the valueFunction and
1272+ * accumulates the mapped values with the given grouping accumulator function on the grouping
1273+ * identity.
1274+ *
1275+ * @param keyFunction The function to select the keys.
1276+ * @param valueFunction The function to apply on each element.
1277+ * @param groupingIdentity The identity, or start value, for the grouping.
1278+ * @param groupingAcc The accumulator to apply on each matching value.
1279+ * @return A HashMap containing the keys with the accumulated result of matched and mapped
1280+ * elements.
1281+ */
12561282 public final <B , C , D > HashMap <B , D > groupBy (
12571283 final F <A , B > keyFunction ,
12581284 final F <A , C > valueFunction , final D groupingIdentity , final F2 <C , D , D > groupingAcc ) {
0 commit comments