ProcessUtil { public static void execProcessInBackground(final String directory, final List<String> cmd) { init(); Callable<Integer> worker = () -> execProcess(directory, cmd); cs.submit(worker); } private  ProcessUtil(); @SuppressWarnings("squid:S3457") // wants parameters in the log statement; would not be helpful here. static synchronized void finish(); static void execProcessInBackground(final String directory, final List<String> cmd); @SuppressWarnings("squid:S1166") // wants log or rethrow exception. It's logged well enough here. static int execProcess(String directory, List<String> cmd);  }
@Test @SuppressWarnings("squid:S2699") public void execProcessInBackground() { List<String> commandLine = Lists.newArrayList("java", "-version"); ProcessUtil.execProcessInBackground(".", commandLine); ProcessUtil.finish(); }