public static Thread[] getAllThreads() {

    // Ok, this lame. This seems to be the easiest way
    // to get all threads in java. Weak.
    Map<Thread, StackTraceElement[]> allStacks = Thread.getAllStackTraces();
    Thread[] results = new Thread[allStacks.size()];
    results = allStacks.keySet().toArray(results);
    return results;
  }
Get all of the threads in this VM. TODO - do this more efficiently. TODO - move this to a more
appropriate location.
geode-core/src/main/java/org/apache/geode/distributed/internal/deadlock/DependencyMonitorManager.java