@Override
    public List<?> read(final Kryo kryo, final Input input, final Class<? extends List<?>> type) {
      final int length = input.readInt(true);
      Class<?> componentType = kryo.readClass(input).getType();
      if (componentType.isPrimitive()) {
        componentType = getPrimitiveWrapperClass(componentType);
      }
      try {
        final Object items = Array.newInstance(componentType, length);
        for (int i = 0; i < length; i++) {
          Array.set(items, i, kryo.readClassAndObject(input));
        }
        return Arrays.asList((Object[]) items);
      } catch (final Exception e) {
        throw new RuntimeException(e);
      }
    }
A kryo {@link Serializer} for lists created via {@link Arrays#asList(Object...)}.
<p>
Note: This serializer does not support cyclic references, so if one of the objects
gets set the list as attribute this might cause an error during deserialization.
</p>
<p/>
This is from kryo-serializers package. Added explicitly to avoid classpath issues.
ql/src/java/org/apache/hadoop/hive/ql/exec/SerializationUtilities.java