java 8 set get first element code example
Example: get first entry in set java
Set<Long> set = new LinkedHashSet<>();
set.iterator().next();
// LinkedHashSet guarantees insertion order
Set<Long> set = new LinkedHashSet<>();
set.iterator().next();
// LinkedHashSet guarantees insertion order