for Java sample code