Here you can find the source of arrayexpend(T[] array, int increment)
@SuppressWarnings("unchecked") public static <T> T[] arrayexpend(T[] array, int increment)
//package com.java2s; import java.lang.reflect.Array; public class Main { @SuppressWarnings("unchecked") public static <T> T[] arrayexpend(T[] array, int increment) { System.arraycopy(/* ww w . j a va2 s . c o m*/ array, 0, array = (T[]) Array.newInstance(array.getClass() .getComponentType(), array.length + increment), 0, array.length - increment); return array; } }