Adding sample code for the Java SDK