New java sample code