If you are not sure what datatype it will take in you can make use of Generics in Java as follows
public static void doSomething(List> data) {
}
public static void main(String [] args) {
List
But while using the data, you will be required to specify proper data type as a Type Cast