some example code for java