Union implementation for new java api, with simple UnionIT testcase