LongXorReduce extends ReduceSameTypeOperation<LongWritable> { @Override public LongWritable reduce(LongWritable curValue, LongWritable valueToReduce) { curValue.set(curValue.get() ^ valueToReduce.get()); return curValue; } LongXorReduce(); @Override LongWritable createInitialValue(); @Override LongWritable reduce(LongWritable curValue,
      LongWritable valueToReduce); @Override void write(DataOutput out); @Override void readFields(DataInput in); static final LongXorReduce INSTANCE; }
@Test public void testXor() { LongWritable curWritable = new LongWritable(0b000L); Assert.assertEquals(0b001L, xor.reduce(curWritable, new LongWritable(0b001L)).get()); Assert.assertEquals(0b011L, xor.reduce(curWritable, new LongWritable(0b010L)).get()); Assert.assertEquals(0b100L, xor.reduce(curWritable, new LongWritable(0b111L)).get()); }