Prefer instanceof over getKind() checks where possible, as these work well with pattern matching instanceofs

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