with `collection[i] instanceof Entity` ?