I run the method
MyObject[] myObjects = append(MyObject.class, myObjectCurrentArray, append1, append2, append3);
public static final <T> T [] append(Class T, T[] array, T... appendThese){
T[] newArray = new Object[array.length + appendThese.length];
//put T[] array and T...appendThese into newArray
return newArray;
}
This throws the Exception
java.lang.ClassCastException: [Ljava.lang.Object; cannot be cast to [Lxxx.MyObject;
How should I fix this?