You have not initialized the inner list. That's the reason you are getting the error.
Following code will initialize each of the inner list.
int initialCapacity=2;
List tmp = new ArrayList(initialCapacity);
for(int i = 0; i < initialCapacity; i++)
tmp.add(new ArrayList());