sample demo for java