Safer duck type test