Not 9, but 47.Therefore, it will return Optional object containing Integer 9 instead of just Integer 9 and you cannot assign an object of class Optional to a variable of type int.
In the question body there is List<Integer> ls = Arrays.asList(10, 47, 33, 23);