Verify & update the java code sample [referring to the area here.](https://github.com/dapr/docs/pull/4596#discussion_r2048722467)