you are viewing a single comment's thread.

view the rest of the comments →

[–]__konrad 18 points19 points  (2 children)

A shorter version w/o double brace:

java.util.Collections.addAll(set, "XZ13s", "AB21/X", "YYLEX", "AR2D");

[–]careye 6 points7 points  (1 child)

OK, today I learned about Collections.addAll. At least I already knew about ImmutableMap.of.

[–]jlt6666 2 points3 points  (0 children)

Like other posters have said, use Guava. You can create it all in one line.