sample of Java code