@Test void args() { when(expression1.args(scope)).thenAnswer(z -> Stream.of("arg1")); when(expression2.args(scope)).thenAnswer(z -> Stream.of("arg2", "arg3")); CoalesceFunction<String> sut = coalesce(expression1).orElse(expression2); Object[] result = sut.args(scope).toArray(); assertThat(result, arrayWithSize(3)); assertThat(result[0], is("arg1")); assertThat(result[1], is("arg2")); assertThat(result[2], is("arg3")); verify(expression1).args(scope); verify(expression2).args(scope); verifyNoMoreInteractions(expression1, expression2); }
@Override public Stream<Object> args(Scope scope) { return terms.stream().flatMap(t -> t.args(scope)); }
CoalesceFunction implements TypedExpression<T> { @Override public Stream<Object> args(Scope scope) { return terms.stream().flatMap(t -> t.args(scope)); } }
CoalesceFunction implements TypedExpression<T> { @Override public Stream<Object> args(Scope scope) { return terms.stream().flatMap(t -> t.args(scope)); } private  CoalesceFunction(TypedExpression<T> expression); }
CoalesceFunction implements TypedExpression<T> { @Override public Stream<Object> args(Scope scope) { return terms.stream().flatMap(t -> t.args(scope)); } private  CoalesceFunction(TypedExpression<T> expression); @Override String sql(Scope scope); @Override Stream<Object> args(Scope scope); @Override Precedence precedence(); @Override String label(Scope scope); @Override RowMapper<T> rowMapper(Scope scope, Optional<String> label); @Override TypeToken<T> type(); @NotNull CoalesceFunction<T> orElse(T value); @NotNull CoalesceFunction<T> orElse(TypedExpression<T> expression); @NotNull CoalesceFunction<T> orElse(Function1<R,T> methodReference); @NotNull CoalesceFunction<T> orElse(FunctionOptional1<R,T> methodReference); @NotNull CoalesceFunction<T> orElse(String alias, Function1<R,T> methodReference); @NotNull CoalesceFunction<T> orElse(String alias, FunctionOptional1<R,T> methodReference); @NotNull CoalesceFunction<T> orElse(Alias<R> alias, Function1<R,T> methodReference); @NotNull CoalesceFunction<T> orElse(Alias<R> alias, FunctionOptional1<R,T> methodReference); @NotNull static CoalesceFunction<T> coalesce(TypedExpression<T> expression); @NotNull static CoalesceFunction<T> coalesce(Function1<R,T> methodReference); @NotNull static CoalesceFunction<T> coalesce(FunctionOptional1<R,T> methodReference); @NotNull static CoalesceFunction<T> coalesce(String alias, Function1<R,T> methodReference); @NotNull static CoalesceFunction<T> coalesce(String alias, FunctionOptional1<R,T> methodReference); @NotNull static CoalesceFunction<T> coalesce(Alias<R> alias, Function1<R,T> methodReference); @NotNull static CoalesceFunction<T> coalesce(Alias<R> alias, FunctionOptional1<R,T> methodReference); }
CoalesceFunction implements TypedExpression<T> { @Override public Stream<Object> args(Scope scope) { return terms.stream().flatMap(t -> t.args(scope)); } private  CoalesceFunction(TypedExpression<T> expression); @Override String sql(Scope scope); @Override Stream<Object> args(Scope scope); @Override Precedence precedence(); @Override String label(Scope scope); @Override RowMapper<T> rowMapper(Scope scope, Optional<String> label); @Override TypeToken<T> type(); @NotNull CoalesceFunction<T> orElse(T value); @NotNull CoalesceFunction<T> orElse(TypedExpression<T> expression); @NotNull CoalesceFunction<T> orElse(Function1<R,T> methodReference); @NotNull CoalesceFunction<T> orElse(FunctionOptional1<R,T> methodReference); @NotNull CoalesceFunction<T> orElse(String alias, Function1<R,T> methodReference); @NotNull CoalesceFunction<T> orElse(String alias, FunctionOptional1<R,T> methodReference); @NotNull CoalesceFunction<T> orElse(Alias<R> alias, Function1<R,T> methodReference); @NotNull CoalesceFunction<T> orElse(Alias<R> alias, FunctionOptional1<R,T> methodReference); @NotNull static CoalesceFunction<T> coalesce(TypedExpression<T> expression); @NotNull static CoalesceFunction<T> coalesce(Function1<R,T> methodReference); @NotNull static CoalesceFunction<T> coalesce(FunctionOptional1<R,T> methodReference); @NotNull static CoalesceFunction<T> coalesce(String alias, Function1<R,T> methodReference); @NotNull static CoalesceFunction<T> coalesce(String alias, FunctionOptional1<R,T> methodReference); @NotNull static CoalesceFunction<T> coalesce(Alias<R> alias, Function1<R,T> methodReference); @NotNull static CoalesceFunction<T> coalesce(Alias<R> alias, FunctionOptional1<R,T> methodReference);  }