@Udf
  public <T> List<T> concat(
      @UdfParameter(description = "First array of values") final List<T> left,
      @UdfParameter(description = "Second array of values") final List<T> right) {
    if (left == null && right == null) {
      return null;
    }
    final int leftSize = left != null ? left.size() : 0;
    final int rightSize = right != null ? right.size() : 0;
    final List<T> result = new ArrayList<>(leftSize + rightSize);
    if (left != null) {
      result.addAll(left);
    }
    if (right != null) {
      result.addAll(right);
    }
    return result;
  }
@Test
  public void shouldReturnNonNullForNullRightInput() {
    final List<String> input1 = Arrays.asList("foo");
    final List<String> result = udf.concat(input1, null);
    assertThat(result, is(Arrays.asList("foo")));
  }