}, tableOf(strings(), pairs(ints(), ints())));
Iterable<String> lines = SecondarySort.sortAndApply(in, new MapFn<Pair<String, Iterable<Pair<Integer, Integer>>>, String>() {
@Override
public String map(Pair<String, Iterable<Pair<Integer, Integer>>> input) {
Joiner j = Joiner.on(',');
return j.join(input.first(), j.join(input.second()));
}
}, strings()).materialize();
assertEquals(ImmutableList.of("one,[-5,10],[1,1],[2,-3]", "three,[0,-1]", "two,[1,7],[2,6],[4,5]"),
ImmutableList.copyOf(lines));
p.done();