update java example code