Inserting a node at a specific position in a linked list
Avoid special cases

If position == null the new node becomes head no matter what, and you don't need to care what the head was before.

Similarly, the validity of position is determined in a traversal loop (if (current == null) condition); testing specifically for head == null &amp;&amp; position != 0 is premature.

BTW, the code handles invalid position inconsistently. Yet another cause to avoid special cases.
Avoid naked loops

Every loop does an important job, and deserves a name. The loop 

for(i = 0; i &lt; position; i++)


serves a purpose of finding a node at the particular position. Factor it out into a method and name it properly.