@Override
    public void validate(String key, Object expected, Object result) {
      Object[] arr = (Object[]) result;
      assertEquals (1, arr.length);

      if (expected == null) {
        assertEquals(null, arr[0]);
      } else {
        assertEquals (true, arr[0] instanceof Object[]);
        Object[] vals = (Object[]) arr[0];
        assertEquals (3, vals.length);

        assertEquals (true, vals[0] instanceof LongWritable);
        assertEquals (true, vals[1] instanceof DoubleWritable);
        assertEquals (true, vals[2] instanceof DoubleWritable);
        LongWritable cnt = (LongWritable) vals[0];
        if (cnt.get() == 0) {
          assertEquals(key, expected, 0.0);
        } else {
          DoubleWritable sum = (DoubleWritable) vals[1];
          DoubleWritable var = (DoubleWritable) vals[2];
          assertTrue (1 <= cnt.get());
          validateVariance (key, (Double) expected, cnt.get(), sum.get(), var.get());
        }
      }
    }
Unit test for the vectorized GROUP BY operator.
ql/src/test/org/apache/hadoop/hive/ql/exec/vector/TestVectorGroupByOperator.java