@Udf(description = "Adds a duration to a time")
  public Time timeAdd(
      @UdfParameter(description = "A unit of time, for example SECOND or HOUR") final TimeUnit unit,
      @UdfParameter(description = "An integer number of intervals to add") final Integer interval,
      @UdfParameter(description = "A TIME value.") final Time time
  ) {
    if (unit == null || interval == null || time == null) {
      return null;
    }
    final long nanoResult = LocalTime.ofNanoOfDay(time.getTime() * 1000_000)
        .plus(unit.toNanos(interval), ChronoUnit.NANOS)
        .toNanoOfDay();
    return new Time(TimeUnit.NANOSECONDS.toMillis(nanoResult));
  }
@Test
  public void handleNullTime() {
    assertNull(udf.timeAdd(TimeUnit.MILLISECONDS, -300, null));
  }