public static <K> IdentityArrayList<K> wrap(final K[] a, final int length) {
    if (length > a.length) {
      throw new IllegalArgumentException("The specified length (" + length
          + ") is greater than the array size (" + a.length + ")");
    }
    final IdentityArrayList<K> l = new IdentityArrayList<>(a, false);
    l.size = length;
    return l;
  }
Wraps a given array into an array list of given size.

@param a an array to wrap.
@param length the length of the resulting array list.
@return a new array list of the given size, wrapping the given array.
geode-core/src/main/java/org/apache/geode/internal/cache/IdentityArrayList.java