package org.requirementsascode.exception;

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

import org.requirementsascode.Step;

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

	public MoreThanOneStepCanReact(Collection<Step> useCaseSteps) {
		super(exceptionMessage(useCaseSteps));
	}
	
	private static String exceptionMessage(Collection<Step> useCaseSteps) {
		String message = "System can react to more than one step: ";
		String useCaseStepsClassNames = useCaseSteps.stream().map(useCaseStep -> useCaseStep.toString())
				.collect(Collectors.joining(",", message, ""));
		return useCaseStepsClassNames;
	}
}

@@ -36,16 +36,45 @@
 ption;%0A%0A
+import java.io.Serializable;%0A
 import j
@@ -322,17 +322,16 @@
 anReact 
- 
 extends 
@@ -347,16 +347,39 @@
 ception 
+implements Serializable
 %7B%09%0A%09priv

Make MoreThanOneStepCanReact class Serializable