### Question:
SimpleExpression extends DslExpression<T> { @Override public SimpleExpression<T> as(Path<T> alias) { return Expressions.operation(getType(),Ops.ALIAS, mixin, alias); } SimpleExpression(Expression<T> mixin); @Override SimpleExpression<T> as(Path<T> alias); @Override SimpleExpression<T> as(String alias); BooleanExpression isNotNull(); BooleanExpression isNull(); NumberExpression<Long> count(); NumberExpression<Long> countDistinct(); BooleanExpression eq(T right); BooleanExpression eq(Expression<? super T> right); BooleanExpression eqAll(CollectionExpression<?, ? super T> right); BooleanExpression eqAny(CollectionExpression<?, ? super T> right); BooleanExpression eqAll(SubQueryExpression<? extends T> right); BooleanExpression eqAny(SubQueryExpression<? extends T> right); BooleanExpression in(Collection<? extends T> right); BooleanExpression in(T... right); BooleanExpression in(CollectionExpression<?,? extends T> right); BooleanExpression in(SubQueryExpression<? extends T> right); BooleanExpression in(Expression<? extends T>... right); BooleanExpression ne(T right); BooleanExpression ne(Expression<? super T> right); BooleanExpression neAll(CollectionExpression<?, ? super T> right); BooleanExpression neAny(CollectionExpression<?, ? super T> right); BooleanExpression notIn(Collection<? extends T> right); BooleanExpression notIn(T... right); final BooleanExpression notIn(CollectionExpression<?,? extends T> right); final BooleanExpression notIn(SubQueryExpression<? extends T> right); final BooleanExpression notIn(Expression<? extends T>... right); SimpleExpression<T> nullif(Expression<T> other); SimpleExpression<T> nullif(T other); CaseForEqBuilder<T> when(T other); CaseForEqBuilder<T> when(Expression<? extends T> other);  }### Answer:
@Test public void as_usage() { SimpleExpression<String> str = new StringPath("str"); assertEquals("str as alias", str.as("alias").toString()); assertEquals("str as alias", str.as(new StringPath("alias")).toString()); }
@SuppressWarnings("unchecked") @Test public void various() { List<DslExpression<?>> paths = new ArrayList<DslExpression<?>>(); paths.add(new ArrayPath(String[].class, "p")); paths.add(new BeanPath(Object.class, "p")); paths.add(new BooleanPath("p")); paths.add(new CollectionPath(String.class, StringPath.class, "p")); paths.add(new ComparablePath(String.class,"p")); paths.add(new DatePath(Date.class,"p")); paths.add(new DateTimePath(Date.class,"p")); paths.add(new EnumPath(ExampleEnum.class,"p")); paths.add(new ListPath(String.class, StringPath.class, "p")); paths.add(new MapPath(String.class, String.class, StringPath.class, "p")); paths.add(new NumberPath(Integer.class,"p")); paths.add(new SetPath(String.class, StringPath.class, "p")); paths.add(new SimplePath(String.class,"p")); paths.add(new StringPath("p")); paths.add(new TimePath(Time.class,"p")); for (DslExpression<?> expr : paths) { Path<?> o = ExpressionUtils.path(expr.getType(), "o"); assertEquals(ExpressionUtils.operation(expr.getType(), Ops.ALIAS, expr, o), expr.as("o")); Path p = ExpressionUtils.path(expr.getType(), "p"); assertEquals(ExpressionUtils.operation(expr.getType(), Ops.ALIAS, expr, p), expr.as(p)); } }