fix Java API sample