Here you can find the source of joinThreads(List
public static boolean joinThreads(List<Thread> threads)
//package com.java2s; //License from project: Open Source License import java.util.Arrays; import java.util.Collection; import java.util.List; public class Main { public static boolean joinThreads(List<Thread> threads) { boolean interrupted = false; for (Thread curThread : threads) { try { curThread.join();//from w w w .ja v a2s.co m } catch (InterruptedException e) { e.printStackTrace(); interrupted = true; break; } } return interrupted; } public static boolean joinThreads(Thread... threads) { return joinThreads(Arrays.asList(threads)); } public static String join(Collection<String> strings, String separator) { StringBuilder sb = new StringBuilder(); String sep = ""; for (String s : strings) { if (s.length() > 0) { sb.append(sep).append(s); sep = separator; } } return sb.toString(); } }