updated caps in java sample code. fixes #2524