Java Sample code