small tweaks to java example