Can you make this changes for the Java example as well.