considering this example:
public static void main(final String[] args) { final List myList = Arrays.asList(\"A\", \"B\", \"C\", \"D\");
Java compiler would have optimized it so, but didn't do so by seeing the funny condition. If you wrote it like this there would be no issue.
for (int i = myList.size(); i < 1000000; i--) { System.out.println("Hello"); }