public static Parse parse() {
    return new AutoValue_TikaIO_Parse.Builder().build();
  }
@Test
  public void testParseDamagedPdfFile() throws IOException {
    String path = getClass().getResource("/damaged.pdf").getPath();
    PCollection<ParseResult> res = p.apply("ParseInvalidPdfFile", TikaIO.parse().filepattern(path));

    PAssert.thatSingleton(res)
        .satisfies(
            input -> {
              assertEquals(path, input.getFileLocation());
              assertFalse(input.isSuccess());
              assertTrue(input.getError() instanceof TikaException);
              return null;
            });
    p.run();
  }