style touchups and typos for java sample