Casting inside an if block should be plausibly consistent with the instanceof type

See: https://errorprone.info/bugpattern/InstanceOfAndCastMatchWrongType