@Udf
  public <T> List<T> mapValues(final Map<String, T> input) {
    if (input == null) {
      return null;
    }
    return Lists.newArrayList(input.values());
  }
@SuppressWarnings("unchecked")
  @Test
  public void shouldHandleComplexValueTypes() {
    final Map<String, Map<String, List<Double>>> input = Maps.newHashMap();

    final Map<String, List<Double>> entry1 = Maps.newHashMap();
    entry1.put("apple", Arrays.asList(Double.valueOf(12.34), Double.valueOf(56.78)));
    entry1.put("banana", Arrays.asList(Double.valueOf(43.21), Double.valueOf(87.65)));
    input.put("foo", entry1);

    final Map<String, List<Double>> entry2 = Maps.newHashMap();
    entry2.put("cherry", Arrays.asList(Double.valueOf(12.34), Double.valueOf(56.78)));
    entry2.put("date", Arrays.asList(Double.valueOf(43.21), Double.valueOf(87.65)));
    input.put("bar", entry2);

    List<Map<String, List<Double>>> values = udf.mapValues(input);
    assertThat(values, containsInAnyOrder(entry1, entry2));
  }