Just out of curiosity, what happens if you optimize by replacing "i < 1000" by "i != 1000" and "i % 2" by "i & 1"? (I don't have the JDK installed.)