convert java example files to ruby