java: Remove more redundant casts