Use instanceof check.