Added documentation for union

Added documentation for union of new java api in 0.5.