More idiomatic test for class membership.