### Question:
ToTrevniTool implements Tool { @Override public int run(InputStream stdin, PrintStream out, PrintStream err, List<String> args) throws Exception { OptionParser p = new OptionParser(); OptionSpec<String> codec = p.accepts("codec", "Compression codec").withRequiredArg().defaultsTo("null") .ofType(String.class); OptionSet opts = p.parse(args.toArray(new String[0])); if (opts.nonOptionArguments().size() != 2) { err.println("Usage: inFile outFile (filenames or '-' for stdin/stdout)"); p.printHelpOn(err); return 1; } args = (List<String>) opts.nonOptionArguments(); DataFileStream<Object> reader = new DataFileStream(Util.fileOrStdin(args.get(0), stdin), new GenericDatumReader<>()); OutputStream outs = Util.fileOrStdout(args.get(1), out); AvroColumnWriter<Object> writer = new AvroColumnWriter<>(reader.getSchema(), new ColumnFileMetaData().setCodec(codec.value(opts))); for (Object datum : reader) writer.write(datum); writer.writeTo(outs); outs.close(); reader.close(); return 0; }  @Override String getName(); @Override String getShortDescription(); @Override int run(InputStream stdin, PrintStream out, PrintStream err, List<String> args);  }### Answer:
@Test public void test() throws Exception { Schema schema = new Schema.Parser().parse(SCHEMA_FILE); DataFileWriter<Object> writer = new DataFileWriter<>(new GenericDatumWriter<>()); writer.create(schema, Util.createFromFS(AVRO_FILE.toString())); for (Object datum : new RandomData(schema, COUNT, SEED)) writer.append(datum); writer.close(); run(AVRO_FILE.toString(), TREVNI_FILE.toString()); AvroColumnReader<Object> reader = new AvroColumnReader<>(new AvroColumnReader.Params(TREVNI_FILE)); Iterator<Object> found = reader.iterator(); for (Object expected : new RandomData(schema, COUNT, SEED)) assertEquals(expected, found.next()); reader.close(); }