Remove duplicates from List using Guava

Probably the most efficient way is ImmutableSet.copyOf(list).asList(), which eliminates duplicates and preserves iteration order.

(But your implementation with LinkedHashSet would be nearly as efficient, and wouldn’t throw up on nulls, in the unlikely event you actually wanted nulls in your collection.)

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)