public static String toDisplayString(long tid) {
    StringBuilder sb = new StringBuilder();
    long lower = Bits.THREAD_ID.extract(tid);
    if (lower != tid) {
      sb.append("0x");
      sb.append(Long.toHexString(tid >> Bits.THREAD_ID.width));
      sb.append("|");
    }
    sb.append(lower);

    return sb.toString();
  }
Extracts the field bits from the value.

@param val the value
@return the field
geode-core/src/main/java/org/apache/geode/internal/cache/ha/ThreadIdentifier.java