make the snippet java