public static Thread getThreadByThisName(String pattern) {
    Thread thread = null;
    for (Thread t : Thread.getAllStackTraces().keySet()) {
      if (t.getName().contains(pattern)) {
        thread = t;
        break;
      }
    }
    return thread;
  }
Return the thread with a name that contains the given name. If there are multiple such threads,
return the first such thread.
@param pattern the pattern to compare
@return the first thread with a name that contains the given pattern.
ambry-test-utils/src/main/java/com/github/ambry/utils/TestUtils.java