added java example from #7