why casting the boolean as integer while the method is expected to return a boolean ?