@Udf
  public <T> List<T> distinct(
      @UdfParameter(description = "Array of values to distinct") final List<T> input) {
    if (input == null) {
      return null;
    }
    final Set<T> distinctVals = Sets.newLinkedHashSetWithExpectedSize(input.size());
    distinctVals.addAll(input);
    return new ArrayList<>(distinctVals);
  }
@Test
  public void shouldReturnNullForNullInput() {
    final List<Double> result = udf.distinct((List<Double>) null);
    assertThat(result, is(nullValue()));
  }