@Udf
  public final <T> Map<String, T> asMap(
      @UdfParameter final List<String> keys,
      @UdfParameter final List<T> values) {
    if (keys == null || values == null) {
      return null;
    }
    final Map<String, T> map = new HashMap<>(keys.size());
    for (int i = 0; i < keys.size(); i++) {
      final String key = keys.get(i);
      final T value = i >= values.size() ? null : values.get(i);

      map.put(key, value);
    }
    return map;
  }
@Test
  public void shouldHandleNullKey() {
    // Given:
    final List<String> keys = Lists.newArrayList("1", null);
    final List<Integer> values = Lists.newArrayList(1, 2);

    // When:
    final Map<String, Integer> map = new AsMap().asMap(keys, values);

    // Then:
    assertThat(map, hasEntry("1", 1));
    assertThat(map, hasEntry(null, 2));
  }