Last active
August 3, 2016 07:23
-
-
Save jhinrichsen/d32a3e40c7c625fbef8964effa42e112 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Sort by multiple keys | |
Collection.metaClass.sort = { Closure... closures -> | |
delegate.sort(false) { a, b -> | |
closures.findResult { c -> c(a) <=> c(b) ?: null } | |
} | |
} | |
List threads = Thread.getThreads() | |
println "${threads.size()}: Threads:" | |
threads.sort({it.threadGroup.name}, {it.name}).each { println "${it.threadGroup.name}: ${it.name.take(80)}" } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment