Calculate Group Size and UnitTest added