Indexoutboundexception error for arraylist : Can someone help me explain why this piece of code is throwing an indexoutbound error 

    public static Hull merging(Hull HullA, Hull HullB) {
		
		Hull finalHull = new Hull();
		
		int i=0;
		int j=0;
		
		
		if (HullA.list.get(i) >= HullB.list.get(j))
		{
			finalHull.list.add(HullA.list.get(i));
			i++;
		}else 
		{
			finalHull.list.add(HullB.list.get(j));
			j++;
		}
		   
       return finalHull;
    }