public static ThriftType fromJSON(String json) {
    return JSON.fromJSON(json, ThriftType.class);
  }
@Test
  public void testParseUnionInfo() throws Exception {
    StructType st = (StructType)
        StructType.fromJSON("{\"id\": \"STRUCT\", \"children\":[], \"structOrUnionType\": \"UNION\"}");
    assertEquals(st.getStructOrUnionType(), StructOrUnionType.UNION);
    st = (StructType)
        StructType.fromJSON("{\"id\": \"STRUCT\", \"children\":[], \"structOrUnionType\": \"STRUCT\"}");
    assertEquals(st.getStructOrUnionType(), StructOrUnionType.STRUCT);
    st = (StructType) StructType.fromJSON("{\"id\": \"STRUCT\", \"children\":[]}");
    assertEquals(st.getStructOrUnionType(), StructOrUnionType.STRUCT);
    st = (StructType)
        StructType.fromJSON("{\"id\": \"STRUCT\", \"children\":[], \"structOrUnionType\": \"UNKNOWN\"}");
    assertEquals(st.getStructOrUnionType(), StructOrUnionType.UNKNOWN);
  }