1import java.util.List; 2 3class Comment { 4 5} 6 7class AnnotationExpr { 8 9} 10 11class ElementOfList { 12 13 void foo() { 14 List<Comment> comments = commentsCollection.getAll(); 15 Object a = comments.get(0); 16 } 17 18 void annotations() { 19 List<AnnotationExpr> annotations = new LinkedList<AnnotationExpr>(); 20 Object a = annotations.get(annotations.size()-1); 21 } 22 23}