public ArrayList<Double> terminate() {
      // This is SQL standard - return state.MaxNArray, or null if the size is zero.
      return state.a.size() == 0 ? null : state.a;
    }
Terminates the max N lookup and return the final result.
contrib/src/java/org/apache/hadoop/hive/contrib/udaf/example/UDAFExampleMaxMinNUtil.java