How to return a List inside this bounded generic method?
问题 I have class Response public class Response<T extends ResponseData> { private final T data; //other fields, getters, setters ... } and the empty interface ResponseData: public interface ResponseData { } It takes any object as data but this object must implement the "empty" interface which I created just to force all classes returned inside "data" element be of same super type Now the problem is that I need to return a List inside the data element, but: I don't find it clean to create a