"Here I am."

"I've been waiting for you here for a long time."

"I hope so. Let's carry on, then."

"I'm going to introduce you to present you a super-duper full-featured utility class for collections."

"I'm already shaking all over with excitement."

"Great. Then let's get started. Here are the methods of the Collections class:"

Code Explanation
boolean addAll(Collection<? super T> c, T... elements)
Adds the passed elements to the passed collection.
This method can be conveniently called like this: Collections.addList (list, 10,11,12,13,14,15)
Queue<T> asLifoQueue(Deque<T> deque)
Returns a «normal queue» made from a deque.
int binarySearch(List<? extends T> list, T key, Comparator<? super T> c)
Performs a binary search for the key element in the list.
The list must be sorted.
You can specify a comparator to compare the elements.
Collection<E> checkedCollection(Collection<E> c, Class<E> type)
Checks that all elements of collection c are of a certain type.
Similar methods exist for List, Map, Set, and SortedSet.
void copy(List<? super T> dest, List<? extends T> src)
Copies the src list to the dest list.
boolean disjoint(Collection<?> c1, Collection<?> c2)
Checks that the collections do not contain common elements
void fill(List<? super T> list, T obj)
Fills list with the element obj
int frequency(Collection<?> c, Object o)
Counts how many times object o exists in collection c
int indexOfSubList(List<?> source, List<?> target)
Determines the index of the first occurrence of the target list within the source list.
The principle is similar to String.indexOf("some string")
int lastIndexOfSubList(List<?> source, List<?> target)
Determines the index of the last occurrence of the target list within the source list.
Similar to String.lastIndexOf("some string")
max(Collection<? extends T> coll)
Searches for the maximum number/value in a collection.
How do we find the maximum of 6 numbers?
Collections.max(Arrays.asList(51, 42, 33, 24, 15, 6));
min(Collection<? extends T> coll)
Searches for the minimum value in a collection.
List<T>nCopies(int n, To)
Creates a dummy collection in which the o element appears n times.
boolean replaceAll(List<T> list, T oldVal, T newVal)
Replaces all oldVal elements in the list with newVal elements
void reverse(List<?> list)
Reverses the list.
void shuffle(List<?> list)
Randomly shuffles the elements of the list.
List<T>singletonList(To)
Returns an immutable list consisting of one passed element.
Similar methods exist for Map, Set, and SortedSet.
void sort(List<T> list)
Sorts the list in ascending order.
void swap(List<?> list, int i, int j)
Swaps the elements of the list
Collection<T>synchronizedCollection(Collection<T> c)
Wraps this collection in a synchronized counterpart.
Similar methods exist for List, Map, Set, and SortedSet.

"Whoa! Yeah, this is a whole arsenal, and I've hardly used any of it."

"Actually, this is where my lesson ends today."

"Take a look at these methods, and find the ones you are most likely to use."

"Or better yet, study them. They will be useful to you."

"Thank you, Rishi. I'll go study."