Sometimes it's an eclipse hiccup and eclipse -clean
plus refreshing all projects helps.
Edit
Does it change anything when you replace your code with:
java.util.List templates = new java.util.ArrayList();
or even
java.util.List<Object> templates = new java.util.ArrayList<Object>();
?