Java code sample