fix top level Java class snippet

I guess it was copied from ruby or something (`end` isn't valid in Java).