Is there any difference between initialization via:
MyWrapper wrapper = new MyWrapper();
vs initialization via:
Before Java 7, the former was required. Now with type inferencing, the latter is preferred.
It is largely because while Java 7 is the current version, a lot of code still uses Java 6, which does not support the latter form.
In essence, Java 7 compilers are better at infering generic types.
The latter is only available since Java 7. That's why you often see the former. The latter is equivalent, and shorter.
JDK 7 allows to not redefine this "redundant" diamond at initialization time.
It's just a shorter syntax.
With JDK <= JDK 6, the latter doesn't work, you have to use the former.