the following code has compilation error in the line of t3:
public List getList() { return new ArrayList(); } public vo
Try casting it to the type T.
public List getList() { return new ArrayList(); } public void first() { List ret = new ArrayList(); List list = getList(); T t1 = ret.get(0); T t2 = list.get(0); T t3 = (T) getList().get(0); }