simplifying java canAssignType() impl