public static ChoiceDefinition when(ChoiceDefinition self, Closure filter) {
return self.when(toExpression(filter));
}
public static ExpressionSupport toExpression(final Closure filter) {
return new ExpressionSupport() {
protected String assertionFailureMessage(Exchange exchange) {
return filter.toString();
}
public <T> T evaluate(Exchange exchange, Class<T> type) {