savedRecord.put("name", "John Doe");
savedRecord.put("age", 42);
savedRecord.put("siblingnames", Lists.newArrayList("Jimmy", "Jane"));
populateGenericFile(Lists.newArrayList(savedRecord), Person.SCHEMA$);
Pipeline pipeline = new MRPipeline(TrevniKeyPipelineIT.class, tmpDir.getDefaultConfiguration());
PCollection<Person> genericCollection = pipeline.read(At.avroFile(avroFile.getAbsolutePath(),
Avros.records(Person.class)));
File outputFile = tmpDir.getFile("output");
Target trevniFile = new TrevniKeyTarget(outputFile.getAbsolutePath());
pipeline.write(genericCollection, trevniFile);
pipeline.run();
Person person = genericCollection.materialize().iterator().next();
PCollection<Person> retrievedPeople = pipeline.read(new TrevniKeySource<Person>(
new Path(outputFile.toURI()), Avros.records(Person.class)));
Person retrievedPerson = retrievedPeople.materialize().iterator().next();
assertThat(retrievedPerson, is(person));