/**
* Returns an expression which converts the given expression to the given type the type
* expression is evaluated to
*/
public static Expression convertToExpression(final Expression expression, final Expression type) {
return new ExpressionAdapter() {
public Object evaluate(Exchange exchange) {
Object result = type.evaluate(exchange, Object.class);
if (result != null) {
return expression.evaluate(exchange, result.getClass());
} else {