Integer[] array = {1,2,3,4,5,6};
Arrays.asList(array).indexOf(4);
Note that this solution is threadsafe because it creates a new object of type List.
Also you don't want to invoke this in a loop or something like that since you would be creating a new object every time
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…