Updating java code snippet and refactoring for hybrid.md

- Updating Java code snippets and replacing with code snippets from samples.
- Refactoring and removing heading for uniformity with other pages.

I am not sure whether having this in documentation is here is a good idea? Any comments?