Updating java code snippet and refactoring
Merge pull request #2976 from moizjv/documentation

Updating java code snippet and refactoring for hybrid.md