@Test
public void testSubprocessReactorLeadingLog() throws Exception {

	List<ProcessLog> processLogs = new ArrayList<>();
	AtomicReference<ProcessLog.Level> levelReference =
		new AtomicReference<>(ProcessLog.Level.WARN);
	Consumer<ProcessLog> processLogConsumer = processLog -> {
		ProcessLog.Level level = processLog.getLevel();
		if (level.compareTo(levelReference.get()) >= 0) {
			processLogs.add(processLog);
		}
	};
	// Warn level
	ProcessChannel<String> processChannel = _localProcessExecutor.execute(
		_createJPDAProcessConfig(_JPDA_OPTIONS1, processLogConsumer),
		Operations.LEADING_LOG);
	Future<String> future = processChannel.getProcessNoticeableFuture();
	Assert.assertEquals("DONE", future.get());
	Assert.assertEquals(processLogs.toString(), 1, processLogs.size());
	ProcessLog processLog = processLogs.remove(0);
	Assert.assertEquals(
		"Found corrupt leading log Leading log", processLog.getMessage());
	// Fine level
	levelReference.set(ProcessLog.Level.DEBUG);
	processChannel = _localProcessExecutor.execute(
		_createJPDAProcessConfig(_JPDA_OPTIONS1, processLogConsumer),
		Operations.LEADING_LOG);
	future = processChannel.getProcessNoticeableFuture();
	Assert.assertEquals("DONE", future.get());
	Assert.assertEquals(processLogs.toString(), 3, processLogs.size());
	processLog = processLogs.remove(0);
	Assert.assertEquals(
		"Found corrupt leading log Leading log", processLog.getMessage());
	processLog = processLogs.remove(0);
	String message = processLog.getMessage();
	Assert.assertTrue(
		message, message.contains("Invoked generic process callable"));
	processLog = processLogs.remove(0);
	message = processLog.getMessage();
	Assert.assertTrue(
		message, message.contains("Invoked generic process callable"));
	// Severe level
	levelReference.set(ProcessLog.Level.ERROR);
	processChannel = _localProcessExecutor.execute(
		_createJPDAProcessConfig(_JPDA_OPTIONS1, processLogConsumer),
		Operations.LEADING_LOG);
	future = processChannel.getProcessNoticeableFuture();
	Assert.assertEquals("DONE", future.get());
	Assert.assertTrue(processLogs.toString(), processLogs.isEmpty());
}