public boolean equals(Object obj) {
    if (!(obj instanceof UUID))
      return false;
    if (((UUID)obj).variant() != this.variant())
      return false;
    UUID id = (UUID)obj;
    return (mostSigBits == id.mostSigBits &&
    leastSigBits == id.leastSigBits);
  }