pattern matching for GroupWithMeasures

example: case GroupWithMeasures(key, measures) => ...