updated Java examples