@SuppressWarnings("unchecked")
@Test
public void various() {
Expression[] args = new Expression[]{new StringPath("x"), new StringPath("y")};
List<Operation<?>> operations = new ArrayList<Operation<?>>();
operations.add(new BooleanOperation(Ops.EQ, args));
operations.add(new ComparableOperation(String.class, Ops.SUBSTR_1ARG, args));
operations.add(new DateOperation(Date.class, Ops.DateTimeOps.CURRENT_DATE, args));
operations.add(new DateTimeOperation(Date.class,Ops.DateTimeOps.CURRENT_TIMESTAMP, args));
operations.add(new EnumOperation(ExampleEnum.class,Ops.ALIAS, args));
operations.add(new NumberOperation(Integer.class,Ops.ADD, args));
operations.add(new SimpleOperation(String.class,Ops.TRIM, args));
operations.add(new StringOperation(Ops.CONCAT, args));
operations.add(new TimeOperation(Time.class,Ops.DateTimeOps.CURRENT_TIME, args));
for (Operation<?> operation : operations) {
Operation<?> other = ExpressionUtils.operation(operation.getType(), operation.getOperator(),
ImmutableList.copyOf(operation.getArgs()));
assertEquals(operation.toString(), operation.accept(ToStringVisitor.DEFAULT, Templates.DEFAULT));
assertEquals(operation.hashCode(), other.hashCode());
assertEquals(operation, other);
assertNotNull(operation.getOperator());
assertNotNull(operation.getArgs());
assertNotNull(operation.getType());
}
}