@Test
public void testInterruptPause() throws Exception {

	String threadNamePrefix = ReflectionTestUtil.invoke(
		ProcessUtil.class, "_buildThreadNamePrefix",
		new Class<?>[] {List.class},
		Arrays.asList(_buildArguments(Pause.class)));
	String threadName = threadNamePrefix + "StdOut";
	SyncThrowableThread<Void> syncThrowableThread =
		new SyncThrowableThread<>(
			() -> {
				while (true) {
					for (Thread thread : ThreadTestUtil.getThreads()) {
						if ((thread != null) &&
							threadName.equals(thread.getName())) {
							thread.interrupt();
							return null;
						}
					}
				}
			});
	syncThrowableThread.start();
	Future<?> future = ProcessUtil.execute(
		new OutputProcessor<Void, Void>() {
			@Override
			public Void processStdErr(InputStream stdErrInputStream) {
				return null;
			}
			@Override
			public Void processStdOut(InputStream stdOutInputStream) {
				return null;
			}
		},
		_buildArguments(Pause.class));
	try {
		future.get();
		Assert.fail();
	}
	catch (ExecutionException executionException) {
		Throwable throwable = executionException.getCause();
		Assert.assertSame(ProcessException.class, throwable.getClass());
		Assert.assertEquals(
			"Forcibly killed subprocess on interruption",
			throwable.getMessage());
	}
	finally {
		syncThrowableThread.sync();
	}
}