Sorry if the title is a bit hard to understand. What I'm trying to do is create a generic method which can take in an ArrayList of any type, and add randomly generated elements to it which are of its type. For example, if I passed an Integer ArrayList to the method, it would generate 10 random Integers and add them to the ArrayList. If it was a Long ArrayList, it would generate 10 random Long values, and so on.Sorry if the title is a bit hard to understand.