This was part of the type inference feature improvement in Java 8, where it works. In Java 8, the type argument can be inferred from the context where the expression is used. Here it is being used in an assignment expression to a ImmutableSet<MyInterface>
variable.
This was not true in Java 7.
In Java 7, you can do
ImmutableSet<MyInterface> a = ImmutableSet.<MyInterface>of(new MyInterface() {
});
to explicitly set the type argument.