code: func (cs *ChangesSync) GetResourceInstanceChange(addr addrs.AbsResourceInstance, gen states.Generation) *ResourceInstanceChangeSrc {
  	if cs == nil {
  		panic("GetResourceInstanceChange on nil ChangesSync")
  	}
  	cs.lock.Lock()
  	defer cs.lock.Unlock()
  
  	if gen == states.CurrentGen {
  		return cs.changes.ResourceInstance(addr).DeepCopy()
  	}
  	if dk, ok := gen.(states.DeposedKey); ok {
  		return cs.changes.ResourceInstanceDeposed(addr, dk).DeepCopy()
  	}
  	panic(fmt.Sprintf("unsupported generation value %#v", gen))
  }
docs: // GetResourceInstanceChange searches the set of resource instance changes for
  // one matching the given address and generation, returning it if it exists.
  //
  // If no such change exists, nil is returned.
  //
  // The returned object is a deep copy of the change recorded in the plan, so
  // callers may mutate it although it's generally better (less confusing) to
  // treat planned changes as immutable after they've been initially constructed.