public virtual ESAbstractAssociation <KeyType, ValueType> withKeyAndValue(KeyType newKey, ValueType newValue) { ESAbstractAssociation <KeyType, ValueType> mutableCopy = (ESAbstractAssociation <KeyType, ValueType>)base.shallowCopy(); mutableCopy.setKeyAndValue(newKey, newValue); if (IsImmutable) { mutableCopy.beImmutable(); } else if (IsKeyImmutable) { mutableCopy.keyBeImmutable(); } return(mutableCopy); }