@Udf
  public Long trunc(@UdfParameter final Long val) {
    return val;
  }
@Test
  public void shouldTruncateBigDecimalWithDecimalPlacesNegative() {
    assertThat(udf.trunc(new BigDecimal("-1.0"), 0), is(new BigDecimal("-1.0")));
    assertThat(udf.trunc(new BigDecimal("-1.1"), 0), is(new BigDecimal("-1.0")));
    assertThat(udf.trunc(new BigDecimal("-1.5"), 0), is(new BigDecimal("-1.0")));
    assertThat(udf.trunc(new BigDecimal("-1.75"), 0), is(new BigDecimal("-1.00")));
    assertThat(udf.trunc(new BigDecimal("-100.1"), 0), is(new BigDecimal("-100.0")));
    assertThat(udf.trunc(new BigDecimal("-100.5"), 0), is(new BigDecimal("-100.0")));
    assertThat(udf.trunc(new BigDecimal("-100.75"), 0), is(new BigDecimal("-100.00")));
    assertThat(udf.trunc(new BigDecimal("-100.10"), 1), is(new BigDecimal("-100.10")));
    assertThat(udf.trunc(new BigDecimal("-100.11"), 1), is(new BigDecimal("-100.10")));
    assertThat(udf.trunc(new BigDecimal("-100.15"), 1), is(new BigDecimal("-100.10")));
    assertThat(udf.trunc(new BigDecimal("-100.17"), 1), is(new BigDecimal("-100.10")));
    assertThat(udf.trunc(new BigDecimal("-100.110"), 2), is(new BigDecimal("-100.110")));
    assertThat(udf.trunc(new BigDecimal("-100.111"), 2), is(new BigDecimal("-100.110")));
    assertThat(udf.trunc(new BigDecimal("-100.115"), 2), is(new BigDecimal("-100.110")));
    assertThat(udf.trunc(new BigDecimal("-100.117"), 2), is(new BigDecimal("-100.110")));
    assertThat(udf.trunc(new BigDecimal("-100.1110"), 3), is(new BigDecimal("-100.1110")));
    assertThat(udf.trunc(new BigDecimal("-100.1111"), 3), is(new BigDecimal("-100.1110")));
    assertThat(udf.trunc(new BigDecimal("-100.1115"), 3), is(new BigDecimal("-100.1110")));
    assertThat(udf.trunc(new BigDecimal("-100.1117"), 3), is(new BigDecimal("-100.1110")));
    assertThat(udf.trunc(new BigDecimal("-1.0"), 3), is(new BigDecimal("-1.0")));
    assertThat(udf.trunc(new BigDecimal("-1.1"), 3), is(new BigDecimal("-1.1")));
    assertThat(udf.trunc(new BigDecimal("-1.5"), 3), is(new BigDecimal("-1.5")));
    assertThat(udf.trunc(new BigDecimal("-1.7"), 3), is(new BigDecimal("-1.7")));
    assertThat(udf.trunc(new BigDecimal("-12345.67"), -2), is(new BigDecimal("-12300.00")));
    assertThat(udf.trunc(new BigDecimal("-12345.67"), -3), is(new BigDecimal("-12000.00")));
    assertThat(udf.trunc(new BigDecimal("-12345.67"), -4), is(new BigDecimal("-10000.00")));
    assertThat(udf.trunc(new BigDecimal("-12345.67"), -5), is(new BigDecimal("0.00")));
  }