public static Thread findThreadById ( final long threadId , final ThreadGroup threadGroup ) { Validate . isTrue ( threadGroup != null , "The thread group must not be null" ) ; final Thread thread = findThreadById ( threadId ) ; if ( thread != null && threadGroup . equals ( thread . getThreadGroup ( ) ) ) { return thread ; } return null ; }
Return the active thread with the specified id if it belongs to the specified thread group .