private void checkRunnable ( Class < ? > type ) { if ( Runnable . class . isAssignableFrom ( type ) ) { try { this . method = type . getMethod ( "run" ) ; } catch ( Exception e ) { throw new RuntimeException ( "Cannot get run method of runnable class." , e ) ; } } }
Checks if the type is a Runnable and gets the run method .