added java sample
fixed typo