What would be an example of two non-isomorphic groups $G$ and $G'$ such that for all groups $H$, there are as many homomorphisms $H\to G$ as homomorphisms $H\to G'$?
By the Yoneda lemma, if $\hom(-,G)$ is naturally isomorphic to $\hom(-,G')$, then $G$ is isomorphic to $G'$. My question aims at finding an example that shows that it doesn't suffice to just assume that $\hom(H,G)$ and $\hom(H,G')$ are isomorphic for all $H$.