group merging in core and a simple unit test