I had to discover I have Java code in my project, which compiles and runs fine in Eclipse, but throws a compilation error in javac.
A self-contained snippet:
I know it's old question, but I want to mention, the function could be written as:
import java.util.HashSet;
import java.util.Set;
public class Main {
public static void main(String[] args) {
Set setOfInts = new HashSet();
Set
It's a little bit cleaner and you can use the function exactly how you intented to(with implicit generic typing).