added a java snippet