Added example java code