@UdafFactory(description = "collect values of a field into a single Array")
  public static <T> TableUdaf<T, List<T>, List<T>> createCollectListT() {
    return new Collect<>();
  }
@Test
  public void shouldUndoAfterHittingLimit() {
    final int limit = 10;
    final TableUdaf<Integer, List<Integer>, List<Integer>> udaf = CollectListUdaf.createCollectListT();
    ((Configurable) udaf).configure(ImmutableMap.of(CollectListUdaf.LIMIT_CONFIG, limit));
    List<Integer> runningList = udaf.initialize();
    for (int i = 0; i < limit ; i++) {
      runningList = udaf.aggregate(i, runningList);
    }
    runningList = udaf.aggregate(limit  + 1, runningList);
    assertThat(limit  + 1, not(isIn(runningList)));
    runningList = udaf.undo(limit  + 1, runningList);
    assertThat(limit  + 1, not(isIn(runningList)));
  }