commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Emmanuel Bourg (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (COLLECTIONS-505) Removing duplicates from a collection
Date Wed, 11 Dec 2013 20:40:07 GMT

    [ https://issues.apache.org/jira/browse/COLLECTIONS-505?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13845709#comment-13845709
] 

Emmanuel Bourg commented on COLLECTIONS-505:
--------------------------------------------

Or soon using Java 8:

{code}List<Integer> result = list.stream().distinct().collect(Collectors.toList());{code}

> Removing duplicates from a collection
> -------------------------------------
>
>                 Key: COLLECTIONS-505
>                 URL: https://issues.apache.org/jira/browse/COLLECTIONS-505
>             Project: Commons Collections
>          Issue Type: New Feature
>          Components: Collection, List
>    Affects Versions: 4.0
>            Reporter: Palvali Teja Burugu
>            Priority: Minor
>
> Remove the duplicate elements from the given collection. Generally, to implement this,
the list would be copied to a set and back to list, which removes all the duplicate elements.
A utility method for this would be a good-to-have feature in the CommonsCollection.



--
This message was sent by Atlassian JIRA
(v6.1.4#6159)

Mime
View raw message