Group detection.
All tests pass.
Refactored Tests.