public static void main(String args[]) throws InterruptedException{
        ThreadPool threadPool = new ThreadPool();
        ThreadPoolImpl impl = new ThreadPoolImpl(4, threadPool);
        int i;
        for(i=0; i < 10; i++){
            MyRunnable runnable = new MyRunnable(i);
            impl.run(runnable);
        }
        Thread.sleep(5000);
        impl.setMax(0);
        Thread.sleep(10000);
        impl.setMax(6);
        for(;i < 15;i++){
            MyRunnable runnable = new MyRunnable(i);
            impl.run(runnable);
        }
    }
Facebook interview question
Implement a non block run which takes as many runnables as given but only
runs a specified number of threads.
You can also update maxSize in between which will change number of threads executing
http://tutorials.jenkov.com/java-concurrency/thread-pools.html
src/com/interview/multithreaded/ThreadPoolImpl.java