public class ConnectorUtils
extends java.lang.Object
Constructor and Description |
---|
ConnectorUtils() |
Modifier and Type | Method and Description |
---|---|
static <T> java.util.List<java.util.List<T>> |
groupPartitions(java.util.List<T> elements,
int numGroups)
Given a list of elements and a target number of groups, generates list of groups of
elements to match the target number of groups, spreading them evenly among the groups.
|
public static <T> java.util.List<java.util.List<T>> groupPartitions(java.util.List<T> elements, int numGroups)
elements
- list of elements to partitionnumGroups
- the number of output groups to generate.