Java's Collections Framework provides many convenient idioms for accomplishing common tasks (e.g., removing a collection's null elements). In this post, I present a handful of these idioms, which can help you write clearer and shorter code.
Easy List Creation
Q: What's the easiest way to create a list?
A: The easiest way to create a list is to use the java.util.Arrays class's <T> List<T> asList(T... a) generic class method, which returns a fixed-size list backed by the specified array.
Read more ...