JAVA : How to return value in generic function
===

I am testing some small practicals with JAVA generics concept.
  
   I try to return a List<T> from a function that is generic but compile does not allow me to do so.

   Check the code below :

   

    package com.test.generic.method;
    
    import java.util.ArrayList;
    import java.util.List;
    
    
    public class Sample_2 {
        
        public <T> List<T> testReturn(){
            List<String> list = new ArrayList<String>();
            list.add("Gunjan");
            list.add("Parth");
            list.add("Devang");
            return list; //ERROR
        }
        
        public static void main(String a[]){
            List<String> list = new ArrayList<String>();
            list.add("Gunjan");
            list.add("Shah");
            
            Sample_1 sample = new Sample_1();
            sample.display(list);        
        }
        
    }


How can I return the list from the generic function ?
And Why JAVA has added such compile time feature ?

Thanks,
Gunjan.
