At step 412, casts are inserted around each method call where ever required, such as whenever the return type is a type parameter (i.e. String s=sv.get(0) is replaced by String s=(String)sv.get(0) and Character c=cv.get(0) is replaced by Character c=(Character)cv.get(0)).