Optimized java code.