Extract union utilities

Useful in other places.

Test: Compiles
Change-Id: I5e3fdd60348c3e47f2cf4582790b82583c0fafee
2 files changed