@UdafFactory(description = "Build a value-to-count histogram of input Strings")
  public static TableUdaf<String, Map<String, Long>, Map<String, Long>> histogramString() {
    return histogram();
  }
@Test
  public void shouldUndoCountedValues() {
    final TableUdaf<String, Map<String, Long>, Map<String, Long>> udaf = HistogramUdaf.histogramString();
    Map<String, Long> agg = udaf.initialize();
    final Boolean[] values = new Boolean[] {true, true, false, null, true};
    for (final Boolean thisValue : values) {
      agg = udaf.aggregate(String.valueOf(thisValue), agg);
    }
    assertThat(agg.entrySet(), hasSize(3));
    assertThat(agg, hasEntry("true", 3L));
    assertThat(agg, hasEntry("false", 1L));
    assertThat(agg, hasEntry("null", 1L));

    agg = udaf.undo("true", agg);
    assertThat(agg.entrySet(), hasSize(3));
    assertThat(agg, hasEntry("true", 2L));
    assertThat(agg, hasEntry("false", 1L));
    assertThat(agg, hasEntry("null", 1L));
  }