The cast is compulsory, because, without it, the compiler will take the "3" as argument of type int, removing an item from the index 3. By putting the cast, we make sure that a call is made to remove(Integer), which will remove the item i.e. Integer object  and not the item at index 3.
Predicting the output is a little hard, as one has to take out some old memories from the mind's cupboard, about the return-type of remove(...). If I am correct, the output should be:
4 true [1, 2, 5]
or if the above is wrong, it may be:
4 3 [1, 2, 5]
Best regards, Abdul Rehman.
Joined: Nov 07, 2006
The following extracts from the JLS, Section 15.12.2 would further elaborate my previous post:-
A method is applicable if it is either applicable by subtyping (�18.104.22.168), applicable by method invocation conversion (�22.214.171.124), or it is an applicable variable arity method (�126.96.36.199).
Discussion The purpose of the division into phases is to ensure compatibility with older versions of the Java programming language.
The first phase (�188.8.131.52) performs overload resolution without permitting boxing or unboxing conversion, or the use of variable arity method invocation. If no applicable method is found during this phase then processing continues to the second phase.
Discussion This guarantees that any calls that were valid in older versions of the language are not considered ambiguous as a result of the introduction of variable arity methods, implicit boxing and/or unboxing.
The second phase (�184.108.40.206) performs overload resolution while allowing boxing and unboxing, but still precludes the use of variable arity method invocation. If no applicable method is found during this phase then processing continues to the third phase.
Discussion This ensures that a variable arity method is never invoked if an applicable fixed arity method exists.
The third phase (�220.127.116.11) allows overloading to be combined with variable arity methods, boxing and unboxing.