public MessageType union(MessageType toMerge) {
    return union(toMerge, true);
  }
@Test
  public void testMergeSchemaWithOriginalType() throws Exception {
    MessageType t5 = new MessageType(
        "root1",
        new GroupType(REQUIRED, "g1", LIST, new PrimitiveType(OPTIONAL, BINARY, "a")),
        new GroupType(REQUIRED, "g2", new PrimitiveType(OPTIONAL, BINARY, "b")));
    MessageType t6 = new MessageType(
        "root1",
        new GroupType(REQUIRED, "g1", LIST, new PrimitiveType(OPTIONAL, BINARY, "a")),
        new GroupType(
            REQUIRED,
            "g2",
            LIST,
            new GroupType(REQUIRED, "g3", new PrimitiveType(OPTIONAL, BINARY, "c")),
            new PrimitiveType(OPTIONAL, BINARY, "b")));

    assertEquals(
        new MessageType(
            "root1",
            new GroupType(REQUIRED, "g1", LIST, new PrimitiveType(OPTIONAL, BINARY, "a")),
            new GroupType(
                REQUIRED,
                "g2",
                LIST,
                new PrimitiveType(OPTIONAL, BINARY, "b"),
                new GroupType(REQUIRED, "g3", new PrimitiveType(OPTIONAL, BINARY, "c")))),
        t5.union(t6));
  }