SubstrFunction implements Function<String> { @Override public Set<String> validateInput(List<Object> args) { return oneOf( args, argsCount(GREATER_THAN_EQUAL, 2), argsCount(LESS_THAN_EQUAL, 3), isInteger(1), isInteger(2) ); }  @Override Set<String> validateInput(List<Object> args); @Override Class<String> getReturnType(); @Override FunctionName getName(); @Override String 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(Collections.singletonList("one")), is(not(empty()))); assertThat(function.validateInput(Arrays.asList("one", "two")), is(not(empty()))); assertThat(function.validateInput(Arrays.asList("one", "two", "three")), is(not(empty()))); assertThat(function.validateInput(Arrays.asList("one", 1)), is(empty())); assertThat(function.validateInput(Arrays.asList("one", 1, 2)), is(empty())); }