Is it possible to check if an entity belongs to a list of entities?

I’m working on a project, and I was wondering if it’s possible to check and see if an entity is part of a set list. If so, how would I go about this?

http://wiki.garrysmod.com/page/table/HasValue?