updating java-client sample code
Merge pull request #2464 from Jonahss/javaSamples

Java samples