@Udf
  public <T> List<T> except(
      @UdfParameter(description = "Array of values") final List<T> left,
      @UdfParameter(description = "Array of exceptions") final List<T> right) {
    if (left == null || right == null) {
      return null;
    }
    final Set<T> distinctRightValues = new HashSet<>(right);
    final Set<T> distinctLeftValues = new LinkedHashSet<>(left);
    return distinctLeftValues
        .stream()
        .filter(e -> !distinctRightValues.contains(e))
        .collect(Collectors.toList());
  }
@Test
  public void shouldRemoveExceptions() {
    final List<String> input1 = Arrays.asList("foo", "bar", "baz");
    final List<String> input2 = Arrays.asList("foo", "bar");
    final List<String> result = udf.except(input1, input2);
    assertThat(result, is(Arrays.asList("baz")));
  }