Added support for union-sublass and unit tests