How to initialize a Set using Eclipse Collections
Initializing a Set using Eclipse Collections is simple and flexible.
I answered the following question on Stack Overflow several years ago.
If you prefer of
instead of with
, the following will work just as well.
If you’d like to understand why Eclipse Collections supports both of
and with
methods on factory classes, the following blog will help.
Thanks for reading! Enjoy!
I am the creator of and a Committer for the Eclipse Collections OSS project which is managed at the Eclipse Foundation. Eclipse Collections is open for contributions.