Skip to content

Instantly share code, notes, and snippets.

@wf-adamhei
Created February 6, 2021 02:34
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Embed
What would you like to do?
def partitionTestClassNames(classNames, buckets) {
def subArrays = []
def bucketSize = classNames.size() / buckets
for (int i = 0; i < buckets; i++) {
def start = i * bucketSize
def end = i == buckets - 1 ? classNames.size() : start + bucketSize
subArrays += [classNames[start..<end]]
}
return subArrays
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment