fixing glitch in Java example