Ktable flatMap+groupBy

i would like to transform a KTable to another KTable:

from:
[a1, b1]
[a2, b2]
[a3, b1]

to:
[b1, [a1, a3]]
[b2, [a2]]

it seems clear to me how to do this by switching to a KStream and then back to a KTable, but then i dont know how to process deletes (tombstones). KGroupedTable would be the obvious route but strangely the selector in groupBy limits me mapping key-values instead of flatMapping (although looking at the code this restriction could be relaxed pretty easily?).

any ideas?
thanks! best, koert