as a tip, you can see pretty deep into the java classes actual source code.
I for example needed once a code for determining
crosspoints between lines, and found it directly in
the sourcecode from a Javaclass.

Here the LinkedList for example:

http://www.docjar.com/html/api/java/util/LinkedList.java.html