Updating example for new java client api