Q:

Generic method accepts different data type list

I want to make a method that accepts all data type list. But it accepting only same data type list. I have done below   
@SafeVarargs
public static <E> List<E> mergeArray(List<E> ...list) {
        List<E> result = new ArrayList<E>(); 
        for(List<E> temp : list) {
            result.addAll(temp); 
        }
        return result; 
    }

    public static void main(String[] args1) {
        List<String> l1 = Arrays.asList("Hello", "World"); 
        List<Double> l2 = Arrays.asList(2.3, 2.2, 4.5); 
        List<Integer> l3 = Arrays.asList(1, 2,3); 
        List<String> l4 = Arrays.asList("Hello1", "World1"); 
        System.out.println(mergeArray(l1, l2));
    }

Here the method mergeArray accepts only mergeArray(l1, l4) //Same data type.
If I passed different data type mean mergeArray(l1,l2) or mergeArray(l1,l2,l3)  it doesn't work.
Is it possible to do? 

A:

It's certainly possible, but I'm not sure it's useful.  Here's a way to do it with bounded wildcard type parameters, though, that doesn't necessarily require the return type to be List<Object>:
public static <E> List<E> mergeArray(@SuppressWarnings("unchecked") List<? extends E> ...list) {
    List<E> result = new ArrayList<E>(); 
    for(List<? extends E> temp : list) {
        result.addAll(temp); 
    }
    return result; 
}

