public static void main(String[] args) {
		MyExecutor myExecutor = new MyExecutor(2, 4, 1000,
				TimeUnit.MILLISECONDS, new LinkedBlockingDeque<Runnable>());
		
		List<Future<String>> results = new ArrayList<>();
		for(int i=0; i<10; i++) {
			Task task = new Task();
			Future<String> result = myExecutor.submit(task);
			results.add(result);
		}
		
		for (int i=0; i<5; i++) {
			try {
				String result = results.get(i).get();
				System.out.printf("Main: result for task %d : %s\n", i, result);
			} catch (InterruptedException | ExecutionException e) {
				e.printStackTrace();
			}
		}
		
		myExecutor.shutdown();
		
		for (int i=5; i<10; i++) {
			try {
				String result = results.get(i).get();
				System.out.printf("Main: result for task %d : %s\n", i, result);
			} catch (InterruptedException | ExecutionException e) {
				e.printStackTrace();
			}
		}
		
		try {
			myExecutor.awaitTermination(3, TimeUnit.MINUTES);
		} catch (InterruptedException e) {
			e.printStackTrace();
		}
		
		System.out.printf("Main: end!\n");
	}