Top "Generic-collections" questions

A collection that supports generic typing of its elements

Case-INsensitive Dictionary with string key-type in C#

If I have a Dictionary<String,...> is it possible to make methods like ContainsKey case-insensitive? This seemed related, …

c# collections generic-collections
Can't add keyValuePair directly to Dictionary

I wanted to add a KeyValuePair<T,U> to a Dictionary<T, U> and I couldn't. …

c# dictionary key-value generic-collections
Using the generic type 'System.Collections.Generic.List<T>' requires 1 type arguments

What does it mean? I used a list of list in ASP.NET MVC and sent them through ViewData of …

c# .net asp.net-mvc generics generic-collections
Java method that returns a function?

I'm using Guava collections' transform functions, and finding myself making a lot of anonymous functions like this pseudocode: Function<…

java guava generic-collections
How do you find an element index in a Collection<T> inherited class?

How do you find the index of an element in a Collection inherited class? public class MyCollection : Collection<MyClass&…

c# inheritance generic-collections
Limit the size of a generic collection?

Is there any way to limit the size of a generic collection? I have a Stack of WriteableBitmap which I …

c# generic-collections
Lists with wildcards cause Generic voodoo error

Does anyone know why the following code does not compile? Neither add() nor addAll() works as expected. Removing the "? extends" …

java generics generic-list generic-collections
C# / .NET equivalent for Java Collections.<T>emptyList()?

What's the standard way to get a typed, readonly empty list in C#, or is there one? ETA: For those …

c# collections generic-collections
"Unchecked generic array creation for varargs parameter of type Matcher <? extends String> []" warning using CoreMatchers.allOf()

In my UT code, extract below, I see warning : Unchecked generic array creation for varargs parameter of type Matcher <? …

java generics generic-collections hamcrest
Avoiding Returning Wildcard Types

I have a class with a collection of Wildcard Types that is a singleton, something like: public ObliviousClass{ private static …

java generics wildcard generic-collections