added sample java code