private boolean isSubTypeOfMvpView ( Class < ? > klass ) { if ( klass . equals ( MvpView . class ) ) { return true ; } Class [ ] superInterfaces = klass . getInterfaces ( ) ; for ( int i = 0 ; i < superInterfaces . length ; i ++ ) { if ( isSubTypeOfMvpView ( superInterfaces [ i ] ) ) { return true ; } } return false ; }
Scans the interface inheritance hierarchy and checks if on the root is MvpView . class