Added java snippet