private static void printLockInfo(LockInfo[] locks, PrintWriter out) {
    out.println(INDENT + "Locked synchronizers: count = " + locks.length);
    for (LockInfo li : locks) {
      out.println(INDENT + "  - " + li);
    }
    out.println();
  }
JUnit run listener which prints full thread dump into System.err in case a test is failed due to
timeout.
hbase-common/src/test/java/org/apache/hadoop/hbase/TimedOutTestsListener.java