@Udf
  public int field(
      @UdfParameter final String str,
      @UdfParameter final String... args
  ) {
    if (str == null || args == null) {
      return 0;
    }

    for (int i = 0; i < args.length; i++) {
      if (str.equals(args[i])) {
        return i + 1;
      }
    }

    return 0;
  }
@Test
  public void shouldFindArgumentWhenOneIsNull() {
    // When:
    final int pos = field.field("world", null, "world");

    // Then:
    assertThat(pos, equalTo(2));
  }