test for monoid and implementation for group comming