You are right that widening comes before boxing, which in turn comes before var-args.
But you seem to be treating the first method as callMethod(Integer i)
, not callMethod(Integer... i)
. Since both methods use var-args, there's a priority tie. That is, neither one meets the criteria for boxing alone, but both meet the criteria for var-args.
Remember that it's illegal to widen, then box (although I did some research before posting this answer and found that it IS legal to box, then widen). Similarly, you won't get box, then var-args behavior; the compiler skips right to the var-args step and sees two methods that take var-args.
EDIT: I should clarify that you WILL get box-then-var-args behavior if there's no ambiguity. In other words, if there was only one callMethod()
, and it took Integer... i
, you would get "Wrapper
."