Are you sure you are using the correct "List"? From line 5 of your code, I see that you are creating a instance of List class. The conventional List container is however an interface and you should have gotten an error at this line itself as interfaces cannot be instantiated.
Can you please type out all your import statements too. That would help us give you further steps to solve the problem.
Be careful with removing elements when using autoboxing. If I take John's example and call listOfInts.remove(2), this will not remove the element 2 but the 3rd element (which doesn't exist). It's not remove(E) that's being called but remove(int) - removal based on index.