sample for java