public static <T> ReadFiles<T> readFiles(Class<T> recordClass) {
    return new AutoValue_ThriftIO_ReadFiles.Builder<T>().setRecordClass(recordClass).build();
  }
@Test
  public void testReadFilesBinaryProtocol() {

    PCollection<TestThriftStruct> testThriftDoc =
        mainPipeline
            .apply(Create.of(THRIFT_DIR + "data").withCoder(StringUtf8Coder.of()))
            .apply(FileIO.matchAll())
            .apply(FileIO.readMatches())
            .apply(ThriftIO.readFiles(TestThriftStruct.class).withProtocol(tBinaryProtoFactory));

    // Assert
    PAssert.that(testThriftDoc).containsInAnyOrder(TEST_THRIFT_STRUCT);

    // Execute pipeline
    mainPipeline.run();
  }