Added java code snippets to document.

Signed-off-by: Froilan <froilan.co@orangeandbronze.com>