/*
* Validation check and return doing-nothing chain object
*/
if (list == null || list.length == 0) {
return new ExitableChain() {
@Override
protected boolean execute(InvocationContext context) {
return true;
}
};
}
ExitableChain currentPoint = list[0];
for (int i = 1; i < list.length; i++) {
currentPoint = currentPoint.setNext(list[i]);
}
return currentPoint;
}