[ELY-94] Replace tests against exact KeySpec types for isAssignableFrom ...

...checks