package org.requirementsascode.exception;

import java.util.Collection;
import java.util.stream.Collectors;

import org.requirementsascode.UseCaseStep;

/**
 * Exception that is thrown when more than one step could react to a certain event.
 * 
 * @author b_muth
 *
 */
public class MoreThanOneStepCouldReactException  extends RuntimeException {	
	private static final long serialVersionUID = 1773129287125843814L;

	/**
	 * Creates an exception because the specified steps could all react,
	 * but only one step that could react is allowed.
	 * 
	 * @param useCaseSteps the steps that could react
	 */
	public MoreThanOneStepCouldReactException(Collection<UseCaseStep> useCaseSteps) {
		super(exceptionMessage(useCaseSteps));
	}
	
	private static String exceptionMessage(Collection<UseCaseStep> useCaseSteps) {
		String message = "System could react to more than one step: ";
		String useCaseStepsClassNames = useCaseSteps.stream().map(useCaseStep -> useCaseStep.toString())
				.collect(Collectors.joining(",", message, ""));
		return useCaseStepsClassNames;
	}
}

@@ -413,195 +413,8 @@
 L;%0A%0A
-%09/**%0A%09 * Creates an exception because the specified steps could all react,%0A%09 * but only one step that could react is allowed.%0A%09 * %0A%09 * @param useCaseSteps the steps that could react%0A%09 */%0A
 %09pub

Remove javadoc