This week's book giveaway is in the OCAJP forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide 1Z0-808 and have Jeanne Boyarsky & Scott Selikoff on-line! See this thread for details.
First, you made the mistake of using list.size instead of list.size(). Since the property "size" does not exist, it will throw an error. Only the method size() exists. Second, you should make sure there is something in the list before checking value within it. Thus, I switched your if statement.