Example code in Java