added groupByStreamOp and tests for flush
added Rep API and tests.