@Udf
  public Integer least(@UdfParameter final Integer val, @UdfParameter final Integer... vals) {

    return (vals == null) ? null : Stream.concat(Stream.of(val), Arrays.stream(vals))
        .filter(Objects::nonNull)
        .min(Integer::compareTo)
        .orElse(null);
  }
@Test
  public void shouldHandleAllNullColumns() {
    assertThat(leastUDF.least((Integer) null, null, null), is(nullValue()));
    assertThat(leastUDF.least((Double) null, null, null), is(nullValue()));
    assertThat(leastUDF.least((Long) null, null, null), is(nullValue()));
    assertThat(leastUDF.least((BigDecimal) null, null, null), is(nullValue()));
    assertThat(leastUDF.least((String) null, null, null), is(nullValue()));
    assertThat(leastUDF.least((ByteBuffer) null, null, null), is(nullValue()));
    assertThat(leastUDF.least((Date) null, null, null), is(nullValue()));
    assertThat(leastUDF.least((Time) null, null, null), is(nullValue()));
    assertThat(leastUDF.least((Timestamp) null, null, null), is(nullValue()));
  }