THRFIT-804. java: CompareTo is broken for unions set to map, set, or list

This patch fixes TUnion's compareTo, and factors out the standard part of the comparison to TBaseHelper.

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@957350 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/test/DebugProtoTest.thrift b/test/DebugProtoTest.thrift
index 5e361d2..c67fbcb 100644
--- a/test/DebugProtoTest.thrift
+++ b/test/DebugProtoTest.thrift
@@ -299,6 +299,8 @@
   4: list<RandomStuff> struct_list;
   5: i32 other_i32_field;
   6: SomeEnum enum_field;
+  7: set<i32> i32_set;
+  8: map<i32, i32> i32_map;
 }
 
 union TestUnionMinusStringField {
@@ -307,6 +309,8 @@
   4: list<RandomStuff> struct_list;
   5: i32 other_i32_field;
   6: SomeEnum enum_field;
+  7: set<i32> i32_set;
+  8: map<i32, i32> i32_map;
 }
 
 union ComparableUnion {
@@ -339,4 +343,5 @@
   1: string field1;
   2: BigFieldIdStruct field2;
   3: i32 field3;
-}
\ No newline at end of file
+}
+