7172737475767778798081
LongWritable maxValue = null; while (values.hasNext()) { LongWritable value = values.next(); if (maxValue == null) { maxValue = value; } else if (value.compareTo(maxValue) > 0) { maxValue = value; } } output.collect(key, maxValue); }