I almost forgot
 -- there should be negative test cases that select SUM, or SUM and MAX, or (for now) MIN and MAX.
 -- and, of course, there should be a "regression" test suite that makes sure that the rewritten plans actually execute.