modify groupByKey to comply with spark definition + add tests

1 job for master in 15 seconds (queued for 2 seconds)
Status Job ID Name Coverage
  Test
failed #5474
test:php72

00:00:15

100.0%
 
Name Stage Failure
failed
test:php72 Test
----------------------------------------------------------------------
76 | ERROR | [x] Expected 1 space after FUNCTION keyword; 0 found
----------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
----------------------------------------------------------------------

Time: 222ms; Memory: 6MB

ERROR: Job failed: exit code 1