Hamcrest Matchers - Assert Type of List
问题 The Problem I'm currently trying to use Hamcrest Matchers to assert that the list type being returned is of a specific type. For example, let's say I have the following List that is being returned by my service call: List<SomePOJO> myList; I want to assert that the list being returned is parametrized of type SomePOJO and not TheOtherPOJO . However, it appears that Hamcrest Matchers does not have this sort of functionality. What I Have Tried After some research, I have seen the following