private void collectAndRegisterOtherDebuggersThreads(List<PyThreadInfo> threads) {
   for (RemoteDebugger d : getOtherDebuggers()) {
     threads.addAll(d.getThreads());
     for (PyThreadInfo t : d.getThreads()) {
       myThreadRegistry.register(t.getId(), d);
     }
   }
 }
  private List<PyThreadInfo> collectAllThreads() {
    List<PyThreadInfo> result = Lists.newArrayList();

    result.addAll(myMainDebugger.getThreads());

    // collect threads and add them to registry to faster access
    // we don't register mainDebugger as it is default if there is no mapping
    for (RemoteDebugger d : myOtherDebuggers) {
      result.addAll(d.getThreads());
      for (PyThreadInfo t : d.getThreads()) {
        myThreadRegistry.register(t.getId(), d);
      }
    }

    return result;
  }
  @Override
  public Collection<PyThreadInfo> getThreads() {
    List<PyThreadInfo> threads = Lists.newArrayList(myMainDebugger.getThreads());

    List<PyThreadInfo> result = Lists.newArrayList();

    cleanOtherDebuggers();

    collectAndRegisterOtherDebuggersThreads(
        threads); // we don't register mainDebugger as it is default if there is no mapping

    if (myOtherDebuggers.size() > 0) {
      // here we add process id to thread name in case there are more then one process
      threads = addProcessIdToThreadName(threads, result);
    }

    return Collections.unmodifiableCollection(threads);
  }