code: public @CheckForNull ThreadType getBlockingThread() {
          if (state.waitingToLock == null && state.waitingOnLock == null) {
              return null;
          }
  
          for (ThreadType thread: runtime.getThreads()) {
              if (thread == this) continue;
              Set<ThreadLock> acquired = thread.getAcquiredLocks();
              if (acquired.isEmpty()) continue;
              if (acquired.contains(state.waitingToLock) || acquired.contains(state.waitingOnLock)) {
                  return thread;
              }
          }
  
          return null;
      }
docs: Get thread blocking this threads execution.
  @return Blocking thread or null if not block by a thread.