code: 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;
      }
docs: Return the active thread with the specified id if it belongs to the specified thread group.
  
  @param threadId The thread id
  @param threadGroup The thread group
  @return The thread which belongs to a specified thread group and the thread's id match the specified id.
  {@code null} is returned if no such thread exists
  @throws IllegalArgumentException if the specified id is zero or negative or the group is null
  @throws  SecurityException
  if the current thread cannot access the system thread group
  
  @throws  SecurityException  if the current thread cannot modify
  thread groups from this thread's thread group up to the system thread group