add nullcheckremoval in Optimize.java