@Override
public void close() {}
};
List<Record> source = new ArrayList<Record>();
source.add(new Record(new IntValue(42), new LongValue(11)));
source.add(new Record(new IntValue(13), new LongValue(17)));
// test reduce
((GroupReduceFunction<Record, Record>) reducer).reduce(source, collector);
assertEquals(2, target.size());
assertEquals(new IntValue(42), target.get(0).getField(0, IntValue.class));
assertEquals(new LongValue(11), target.get(0).getField(1, LongValue.class));
assertEquals(new IntValue(13), target.get(1).getField(0, IntValue.class));
assertEquals(new LongValue(17), target.get(1).getField(1, LongValue.class));
target.clear();
// test combine
((FlatCombineFunction<Record>) reducer).combine(source, collector);
assertEquals(2, target.size());
assertEquals(new IntValue(42), target.get(0).getField(0, IntValue.class));
assertEquals(new LongValue(11), target.get(0).getField(1, LongValue.class));
assertEquals(new IntValue(13), target.get(1).getField(0, IntValue.class));
assertEquals(new LongValue(17), target.get(1).getField(1, LongValue.class));
target.clear();
// test the serialization
SerializationUtils.clone((java.io.Serializable) reducer);
}