fixed up java sample code in docs