public static ParamType getVarArgsSchemaFromType(final Type type) {
    return getSchemaFromType(type, VARARGS_JAVA_TO_ARG_TYPE);
  }
@Test
  public void shouldGetFunctionVariadic() throws NoSuchMethodException {
    final Type type = getClass().getDeclaredMethod("functionType", Function.class)
            .getGenericParameterTypes()[0];
    final ParamType schema = UdfUtil.getVarArgsSchemaFromType(type);
    assertThat(schema, instanceOf(LambdaType.class));
    assertThat(((LambdaType) schema).inputTypes(), equalTo(ImmutableList.of(ParamTypes.LONG)));
    assertThat(((LambdaType) schema).returnType(), equalTo(ParamTypes.INTEGER));
  }