public static Matcher < Class < ? > > subclassOf ( final Class < ? > klazz ) { return new Matcher < Class < ? > > ( ) { @ Override protected boolean matchesSafely ( Class < ? > t ) { return klazz . isAssignableFrom ( t ) ; } @ Override public String toString ( ) { return "a subtype of " + klazz ; } } ; }
Returns a matcher that matches classes that are sub - types of the supplied class .