code: public static String threadIdToString(int threadId) {
          StringBuffer buffer = new StringBuffer(8);
  
          // pad the HexString ThreadId so that it is always 8 characters long.
          for (int shift = 7; shift >= 0; shift--) {
              buffer.append(hexChars[(threadId >> (shift << 2)) & 0xF]);
          }
  
          return buffer.toString();
      }
docs: Converts provided thread id into eight character hexadecimal string
  
  @param threadId id to convert
  @return String representation of the thread id