If this were a regular array, I could just create a new array and then do arraycopy, but generics won\'t let me do that. The best thing I\'ve come up with so far is:
you can use Arrays.copyOf(myArray,myArray.length*3) to make the copy
Arrays.copyOf(myArray,myArray.length*3)
my guess is that myArray[0] is null so myArray[0].getClass() throws the nullpointer
myArray[0]
myArray[0].getClass()
if you need the runtime type of the components you can use myArray.getClass().getComponentType()