Update ArrayList.java

Add some changes for generic