@Override
  public void readOne(TProtocol in, TProtocol out) throws TException {
    readOneStruct(in, out);
  }
@Test
  public void testUnrecognizedUnionMemberSchema() throws Exception {
    CountingErrorHandler countingHandler = new CountingErrorHandler();
    BufferedProtocolReadToWrite p = new BufferedProtocolReadToWrite(
        ThriftSchemaConverter.toStructType(StructWithUnionV1.class), countingHandler);
    final ByteArrayOutputStream in = new ByteArrayOutputStream();
    final ByteArrayOutputStream out = new ByteArrayOutputStream();
    StructWithUnionV1 validUnion = new StructWithUnionV1("a valid struct", UnionV1.aLong(new ALong(17L)));
    StructWithUnionV2 invalidUnion =
        new StructWithUnionV2("a struct with new union member", UnionV2.aNewBool(new ABool(true)));

    validUnion.write(protocol(in));
    invalidUnion.write(protocol(in));

    ByteArrayInputStream baos = new ByteArrayInputStream(in.toByteArray());

    // first one should not throw
    p.readOne(protocol(baos), protocol(out));

    try {
      p.readOne(protocol(baos), protocol(out));
      fail("this should throw");
    } catch (SkippableException e) {
      Throwable cause = e.getCause();
      assertEquals(DecodingSchemaMismatchException.class, cause.getClass());
      assertTrue(cause.getMessage().startsWith("Unrecognized union member with id: 3 for struct:"));
    }
    assertEquals(0, countingHandler.recordCountOfMissingFields);
    assertEquals(0, countingHandler.fieldIgnoredCount);
  }