updating java-client sample code