News for hackers. Stuff that matters.
Re:Better Java – Resources for Writing Modern Java by adpreese on Saturday September 19, 2015 @08:07PM (#10246025)
He mentions Lombok in the tools section.

And Guava's collection creation methods are part of an intense desire to not use the new key word anywhere in application code.

Re:Better Java – Resources for Writing Modern Java by kilink on Saturday September 19, 2015 @08:33PM (#10246090)
Also, if you look at the Javadocs for some of the creation methods, they explicitly state that they are for Java 6 and earlier, and that modern code should just use the constructor with the diamond syntax.

http://docs.guava-libraries.googlecode.com/git/javadoc/com/g...

Re:Better Java – Resources for Writing Modern Java by Pyxl101 on Saturday September 19, 2015 @10:54PM (#10246412)
The other replies kind of hit on this, but I'll expand on it by saying:

The collection creation methods existed because Java could perform type inference on methods but could not on constructors:

  // Java 1.5
  Map<String,Integer> map = new HashMap<String,Integer>();
  // Guava
  Map<String,Integer> map = Maps.newHashMap();
  // Java 1.8 diamond notation
  Map<String,Integer> map = new HashMap<>();
Re:Better Java – Resources for Writing Modern Java by kilink on Saturday September 19, 2015 @08:28PM (#10246073)
I realize he mentions Lombok, but he specifically bemoans the extra boilerplate with writing builders and data classes, but does not mention the @Data or @Builder annotations...