NamedExpression implements Expression { public String getName() { return Strings.isNullOrEmpty(alias) ? name : alias; }  @Override ExprValue valueOf(Environment<Expression, ExprValue> valueEnv); @Override ExprType type(); String getName(); @Override T accept(ExpressionNodeVisitor<T, C> visitor, C context);  }
@Test void name_an_expression_with_alias() { LiteralExpression delegated = DSL.literal(10); NamedExpression namedExpression = DSL.named("10", delegated, "ten"); assertEquals("ten", namedExpression.getName()); }
@Test void name_an_named_expression() { LiteralExpression delegated = DSL.literal(10); Expression expression = DSL.named("10", delegated, "ten"); NamedExpression namedExpression = DSL.named(expression); assertEquals("ten", namedExpression.getName()); }