Top "Collections" questions

Collections APIs provide developers with a set of classes and interfaces that make it easier to handle collections of objects.

Why there is no ConcurrentHashSet against ConcurrentHashMap

HashSet is based on HashMap. If we look at HashSet<E> implementation, everything is been managed under HashMap&…

java collections concurrency hashmap hashset
Iterating through a list in reverse order in java

I'm migrating a piece of code to make use of generics. One argument for doing so is that the for …

java collections
Create a List of primitive int?

Is there a way to create a list of primitive int or any primitives in java like following? List<…

java list generics collections
Assert equals between 2 Lists in Junit

How can I make an equality assertion between lists in a JUnit test case? Equality should be between the content …

java unit-testing collections junit
How to check if IEnumerable is null or empty?

I love string.IsNullOrEmpty method. I'd love to have something that would allow the same functionality for IEnumerable. Is there …

c# .net linq collections ienumerable
HashSet vs. List performance

It's clear that a search performance of the generic HashSet<T> class is higher than of the generic …

.net performance collections list hash
Binding a list in @RequestParam

I'm sending some parameters from a form in this way: myparam[0] : 'myValue1' myparam[1] : 'myValue2' myparam[2] : 'myValue3' otherParam : …

java spring data-binding collections spring-mvc
Most concise way to convert a Set<T> to a List<T>

For example, I am currently doing this: Set<String> setOfTopicAuthors = .... List<String> list = Arrays.asList( setOfTopicAuthors.…

java list collections set jdk1.6
Android-java- How to sort a list of objects by a certain value within the object

Im trying to sort through an arraylist of objects by a particular value within the object. What would be the …

java android sorting collections comparator
Thread-safe List<T> property

I want an implementation of List<T> as a property which can be used thread-safely without any doubt. …

c# collections properties thread-safety