Added Java code