The thing is like this: I have a method which has int as its return value (the method signature cannot be changed), but in the implementation of this method, I found very hard to define the length of this return value until the end. So I used List to contain return values first and thinking I could extract this list to the int and return. But I didn't find any existing method for doing so, I mean converting Integer List to int. What I did now is write a separate method to interate over Integer list and construct the int to return.
Is there any convenient method there for me to use? Because I feel a little embarrassed to write this conversion like code.