private void fuzz(String ext, Path src, Path targetFileBase, Transformer transformer,
                      long timeoutMs) throws IOException, TikaException {

        Path target =
                targetFileBase.getParent().resolve(targetFileBase.getFileName().toString() + ext);

        try {
            transformFile(transformer, src, target);
        } catch (Throwable t) {
            LOG.warn("failed to transform: " + src.toString());
            Files.delete(target);
            throw t;
        }
        ExecutorService executor = Executors.newFixedThreadPool(1);
        Future<Integer> future = executor.submit(new ParseTask(target));

        try {
            int result = future.get(timeoutMs, TimeUnit.MILLISECONDS);
            if (result == 1 && Files.exists(target)) {
                LOG.warn("failed to delete target: " + target);
            }
        } catch (TimeoutException e) {
            LOG.warn("timeout exception:" + target);
            future.cancel(true);
            writeErrFile(target, ".timeout");
            System.exit(1);
        } catch (InterruptedException | ExecutionException e) {
            LOG.warn("problem parsing " + target, e);
            System.exit(1);
        } finally {
            executor.shutdownNow();
        }
    }
Forked process that runs against a single input file
tika-fuzzing/src/main/java/org/apache/tika/fuzzing/cli/FuzzOne.java