[Demonstration 1]

[Buggy Method]
protected void setup(Context context) throws IOException, InterruptedException {
    mos = new MultipleOutputs(context);
}

[Buggy Hunk]
mos = new MultipleOutputs(context);

[Patch]
mos = new MultipleOutputs<Text, BytesWritable>(context);

[Demonstration 2]

[Buggy Method]
@Override
protected void cleanup(Context context) throws IOException, InterruptedException {
    log.info("Writing model");
    TopicModel readFrom = modelTrainer.getWriteModel();
    TupleWritable[] container = new TupleWritable[tupleMatrix.get(0).size()];
    for (MatrixSlice topic : readFrom) {
        Writable[] topicModelRow = { new IntWritable(-1), new VectorWritable(topic.getVector()) };
        tupleMatrix.get(topic.index()).add(0, new TupleWritable(topicModelRow));
        context.write(new IntWritable(topic.index()), new ArrayWritable(TupleWritable.class, tupleMatrix.get(topic.index()).toArray(container)));
        Arrays.fill(container, null);
    }
}

[Buggy Hunk]
context.write(new IntWritable(topic.index()), new ArrayWritable(TupleWritable.class, tupleMatrix.get(topic.index()).toArray(container)));

[Patch]
context.write(new IntWritable(topic.index()), new TupleArrayWritable(tupleMatrix.get(topic.index()).toArray(container)));