add setGroupState() method and tests