ModFunction implements Function<Double> { @Override public Set<String> validateInput(List<Object> args) { return oneOf( args, argsCount(2), isNumber(0), isNumber(1), numberRelation(1, GREATER_THAN, 0) ); }  @Override Set<String> validateInput(List<Object> args); @Override Class<Double> getReturnType(); @Override FunctionName getName(); @Override Double apply(List<Object> objects); @Override String getSignature(); @Override String getDescription();  }
@Test public void validateInput() throws Exception { assertThat(function.validateInput(Collections.emptyList()), is(not(empty()))); assertThat(function.validateInput(Arrays.asList("nan", "nan")), is(not(empty()))); assertThat(function.validateInput(Arrays.asList(1, 0)), is(not(empty()))); assertThat(function.validateInput(Arrays.asList(2, 3)), is(empty())); }