@Udf
  public <T> List<T> remove(
      @UdfParameter(description = "Array of values") final List<T> array,
      @UdfParameter(description = "Value to remove") final T victim) {
    if (array == null) {
      return null;
    }

    return array.stream()
        .filter(el -> !Objects.equals(el, victim))
        .collect(Collectors.toList());
  }
@SuppressWarnings("unchecked")
  @Test
  public void shouldRemoveMap() {
    final Map<String, Integer> map1 = ImmutableMap.of("foo", 1, "bar", 2, "baz", 3);
    final Map<String, Integer> map2 = ImmutableMap.of("foo", 10, "baz", 3);
    final Map<String, Integer> map3 = ImmutableMap.of("foo", 1, "bar", 2, "baz", 3);
    final List<Map<String, Integer>> input1 = Arrays.asList(map1, map2, map3);
    final Map<String, Integer> input2 = map3;
    final List<Map<String, Integer>> result = udf.remove(input1, input2);
    assertThat(result, contains(map2));
  }