Center not is fully invariant in class two p-group

Statement
Let $$p$$ be a prime number. There exists a p-group $$G$$ of class two whose fact about::center is not a fact about::fully invariant subgroup.

Related facts

 * Characteristic not implies fully invariant in odd-order class two p-group
 * Socle not is fully invariant in class two p-group
 * Characteristic not implies fully invariant in class three maximal class p-group

Proof
Let $$p$$ be a prime. Let $$P$$ be any non-abelian group of order $$p^3$$ with center $$Z$$ (if $$p = 2$$, choose $$P$$ to be dihedral group:D8. Otherwise there are two possibilities for $$P$$: a group of prime-square exponent, and a group of prime exponent). In all these groups, there is an element $$x$$ of order $$p$$ outside $$Z$$.

Define $$G = P \times C$$ where $$C$$ is the cyclic group of order $$p$$ with generator $$y$$. The center of $$G$$ is the subgroup $$H = Z \times C$$.

Then $$H$$ is not fully invariant in $$G$$: Consider the retraction with kernel $$P \times \{ e \}$$ and with image generated by the element $$(x,y)$$. This is an endomorphism of $$G$$, but it does not send $$H$$ to itself, since the element $$(e,y)$$ gets sent to $$(x,y)$$, which is outside $$H$$.