public static <T> void smartRemoveDuplicatesAndNullsHelper(
			List<T> list, int startIx, T objSeenPreviously) 
	{
		while (startIx < list.size() &&
			   (list.get(startIx) == null || 
			    list.get(startIx) == objSeenPreviously || 
			    list.get(startIx).equals(objSeenPreviously))) 
		{
			int lastItemIx = list.size()-1;
			
			// Overwrite the item at laterIx with the one at the end, 
			// then delete the one at the end.
			list.set(startIx, list.get(lastItemIx));
			list.remove(lastItemIx);
		}
	}