Top "Collections" questions

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

Jquery how to find an Object by attribute in an Array

Given I have an array of "purpose" objects: //array of purpose objects: var purposeObjects = [ {purpose: "daily"}, {purpose: "weekly"}, {purpose: "monthly"} ]; (…

jquery collections filter traversal
ConcurrentModificationException for ArrayList

I have the following piece of code: private String toString(List<DrugStrength> aDrugStrengthList) { StringBuilder str = new StringBuilder(); for (…

java collections concurrency
Is there a common Java utility to break a list into batches?

I wrote myself a utility to break a list into batches of given size. I just wanted to know if …

java collections
Checking that a List is not empty in Hamcrest

I was wondering if anyone knew of a way to check if a List is empty using assertThat() and Matchers? …

java collections junit hamcrest
java collections - keyset() vs entrySet() in map

I put a string array elements is a map where elements of string array is key and frequency of word …

java collections hashmap linkedhashmap keyset
Does List<T> guarantee insertion order?

Say I have 3 strings in a List (e.g. "1","2","3"). Then I want to reorder them to place "2" in position 1 (e.…

c# .net collections
java.math.BigInteger cannot be cast to java.lang.Long

I've got List<Long> dynamics. And I want to get max result using Collections. This is my code: …

java hibernate collections long-integer biginteger
What is a practical, real world example of the Linked List?

I understand the definition of a Linked List, but how can it be represented and related to a common concept …

collections linked-list car-analogy
AddRange to a Collection

A coworker asked me today how to add a range to a collection. He has a class that inherits from …

c# collections c#-3.0 extension-methods
Creating a constant Dictionary in C#

What is the most efficient way to create a constant (never changes at runtime) mapping of strings to ints? I've …

c# .net collections dictionary constants