Generics are not supported insource 14 use version 5 or higher
This might be a common error while working with Generics in Netbeans.
The problem is that you are using older version of Runtime environment maybe 4 or less.
Solution :
Right click the netbeans project
Go to Sources
In source Binary Format select 5 or 6
Now you wont get the earlier error.