assertEquals(ImmutableList.of(Pair.of("foo", 12), Pair.of("bar", 17)), bottom2.materialize());
}
@Test
public void testTopN_MRPipeline() throws IOException {
Pipeline pipeline = new MRPipeline(AggregateIT.class, tmpDir.getDefaultConfiguration());
PTable<StringWrapper, String> entries = pipeline
.read(From.textFile(tmpDir.copyResourceFileName("set1.txt"), Avros.strings()))
.by(new StringWrapper.StringToStringWrapperMapFn(), Avros.reflects(StringWrapper.class));
PTable<StringWrapper, String> topEntries = Aggregate.top(entries, 3, true);
List<Pair<StringWrapper, String>> expectedTop3 = Lists.newArrayList(
Pair.of(StringWrapper.wrap("e"), "e"),