Code example for LinkedList

Methods: addFirst, indexOf, remove

0
	 * @param whichElement 
	 *            moves this to first position 
	 */ 
	public void moveFirst( ELEMENT whichElement ) {
		assert Q.nn( whichElement );
		int index = list.indexOf( whichElement );
		if ( index > 1 ) {// aka avoid not found or already first
			ELEMENT prev = list.remove( index );
			assert null != prev;
			assert prev == whichElement : " they were not ref equal, are they .equals? =" + whichElement.equals( prev );
			list.addFirst( prev );
		} 
	} 
	 
	 
	public int size() { 
		return list.size();
	} 
	 
	 
	public void addFirst( ELEMENT elem ) {