}
}
if (terminationList.size() == 1) {
return terminationList.get(0);
} else if (terminationList.size() > 1) {
AbstractCompositeTermination compositeTermination;
if (terminationCompositionStyle == null || terminationCompositionStyle == TerminationCompositionStyle.OR) {
compositeTermination = new OrCompositeTermination();
} else if (terminationCompositionStyle == TerminationCompositionStyle.AND) {
compositeTermination = new AndCompositeTermination();
} else {
throw new IllegalStateException("The terminationCompositionStyle (" + terminationCompositionStyle
+ ") is not implemented");
}
compositeTermination.setTerminationList(terminationList);
return compositeTermination;
} else {
return null;
}
}