@Udf
  public <T extends Comparable<? super T>> T arrayMin(@UdfParameter(
      description = "Array of values from which to find the minimum") final List<T> input) {
    if (input == null) {
      return null;
    }

    T candidate = null;
    for (T thisVal : input) {
      if (thisVal != null) {
        if (candidate == null) {
          candidate = thisVal;
        } else if (thisVal.compareTo(candidate) < 0) {
          candidate = thisVal;
        }
      }
    }
    return candidate;
  }
@Test
  public void shouldFindDecimalMin() {
    final List<BigDecimal> input =
        Arrays.asList(BigDecimal.valueOf(1.2), BigDecimal.valueOf(1.3), BigDecimal.valueOf(-1.2));
    assertThat(udf.arrayMin(input), is(BigDecimal.valueOf(-1.2)));
  }