Donald Raab
Sep 27, 2023

--

Thanks Jose. I understand quite well my options for looking up elements in a Set and Map. I was a member of the JSR 335 Expert Group that got Lambdas and the Stream API into Java 8. I think perhaps you are not understanding the point of the blog and that is ok. I provided an example using Java Streams to find the identical element in the Set. Notice all my test cases use assertSame() and not assertEquals(). I explain that a Map could be used, even though a HashSet is just a HashMap.

--

--

Donald Raab
Donald Raab

Written by Donald Raab

Java Champion. Creator of the Eclipse Collections OSS Java library (https://github.com/eclipse/eclipse-collections). Inspired by Smalltalk. Opinions are my own.

No responses yet