Sample java codes