Optimize imports of Java classes