class Pump {

  public GroupByPump groupby(String... fields) {
    return new GroupByPump(this, fields);
  }

}

class TestPump {

  private static final String INPUT2_PATH;
  private static final String NULL_INPUT_PATH;
  private static final String OUTPUT_PATH2;
  private static final List<Tuple> INPUT2_TUPLES;
  private static final List<Tuple> NULL_TUPLES;

  @Test
  public void testGroupBy() throws Exception {

    Pipe p = Pump.prime()
        .each(new RegexFilter("^[0-9]+$", false), "line")
        .retain("line")
        .coerce("line", int.class)
        .each(new DateFormatter(new Fields("date"), "yyyy-MM-dd"))
        .retain("date")
        .groupby("date")
        .toPipe();

    CascadingHelper.get().getFlowConnector().connect(Tests.getInTap(), Tests.getOutTap(), p).complete();

    assertEquals(Arrays.asList("1970-01-01", "1970-01-02", "1970-01-02"), getOutputStrings());
  }

}