Collection<PyThreadInfo> () { cleanOtherDebuggers(); List<PyThreadInfo> threads = collectAllThreads(); if (myOtherDebuggers.size() > 0) { //here we add process id to thread name in case there are more then one process return Collections.unmodifiableCollection(Collections2.transform(threads, t -> { if (t == null) return null; String threadName = ThreadRegistry.threadName(t.getName(), t.getId()); PyThreadInfo newThread = new PyThreadInfo(t.getId(), threadName, t.getFrames(), t.getStopReason(), t.getMessage()); newThread.updateState(t.getState(), t.getFrames()); return newThread; })); } else { return Collections.unmodifiableCollection(threads); } }