add java snippet