public static Future execute(ParseContext context, Runnable runnable) {

        Future future = null;
        ExecutorService executorService = context.get(ExecutorService.class);
        if (executorService == null) {
            FutureTask task = new FutureTask<>(runnable, null);
            Thread thread = new Thread(task, "Tika Thread");
            thread.start();
            future = task;
        } else {
            future = executorService.submit(runnable);
        }

        return future;
    }
@Test
    public void testExecuteExecutor() throws Exception {
        TikaConfig config = TikaConfig.getDefaultConfig();
        ParseContext context = new ParseContext();
        context.set(ExecutorService.class, config.getExecutorService());
        Future result = ConcurrentUtils.execute(context, () ->
        {
            //Do nothing
        });

        assertNull(result.get());
    }