I just found out about a very interesting Java trick:
void method1(Integer... a){ }
So you can give this method as many integers as you want.>
A call will made to method1(int a, int b) . Just checked byte code for this - here Integer... a is actually an Integer[] a For a detailed conversion check these assignment conversion
Integer... a
Integer[] a