Code example for ThreadFactoryBuilder

0
     * ThreadFactory and will be assigned sequentially. 
     * @return the created ThreadFactory 
     */ 
    public static ThreadFactory threadsNamed(String nameFormat)
    { 
        return new ThreadFactoryBuilder()
                .setNameFormat(nameFormat)
                .setThreadFactory(new ContextClassLoaderThreadFactory(Thread.currentThread().getContextClassLoader()))
                .build();
    } 
 
    /** 
     * Creates a {@link ThreadFactory} that creates named daemon threads. 
     * using the specified naming format. 
     * 
     * @param nameFormat see {@link #threadsNamed(String)} 
     * @return the created ThreadFactory 
     */ 
    public static ThreadFactory daemonThreadsNamed(String nameFormat)
    {