Added example in Java.