code: func (tab *Table) replace(b *bucket, last *node) *node {
  	if len(b.entries) == 0 || b.entries[len(b.entries)-1].ID() != last.ID() {
  		// Entry has moved, don't replace it.
  		return nil
  	}
  	// Still the last entry.
  	if len(b.replacements) == 0 {
  		tab.deleteInBucket(b, last)
  		return nil
  	}
  	r := b.replacements[tab.rand.Intn(len(b.replacements))]
  	b.replacements = deleteNode(b.replacements, r)
  	b.entries[len(b.entries)-1] = r
  	tab.removeIP(b, last.IP())
  	return r
  }
docs: // replace removes n from the replacement list and replaces 'last' with it if it is the
  // last entry in the bucket. If 'last' isn't the last entry, it has either been replaced
  // with someone else or became active.