sample JAVA code