core: prevent attempts to merge a group with itself
core: a non-trivial group merge unit test