@SuppressWarnings("unchecked")
	private static Boolean runQueueProcessors(String fileName, int queueProcessorCount, String firstCity, String secondCity, Boolean displayTiming) {
        List<FutureTask<Void>> futures = new ArrayList<>();
        ExecutorService executor = Executors.newFixedThreadPool(queueProcessorCount);
        
        UnionFindGraph graph = new UnionFindGraph(firstCity,secondCity,new ConnectedCities());
        queueProcessors = new QueueProcessor[queueProcessorCount];
        BlockingQueue<List<String>>[] queues = new BlockingQueue[queueProcessorCount];
        for(int i = 0; i < queueProcessorCount; i++){
        	QueueProcessor currentProcessor =new QueueProcessor(graph);
        	queueProcessors[i] = currentProcessor;
        	queues[i] = currentProcessor.getQueue();
        }
        
        for (QueueProcessor queueProcessor: queueProcessors){
            FutureTask<Void> future = new FutureTask<Void>(queueProcessor);
            futures.add(future);
            executor.submit(future);
        }
        
        try {
			FilePartitioner.partitionFileIntoQueues(fileName, queues,displayTiming);
		} catch (IOException e) {
			System.out.println("Could not open " + fileName);
			e.printStackTrace();
		}
        
        for (QueueProcessor queueProcessor: queueProcessors){
            queueProcessor.allDataHasBeenPutInQueue();
        }
        executor.shutdown();
        try {
			if (!executor.awaitTermination(2, TimeUnit.SECONDS)) { //optional *
				Logger logger = Logger.getLogger(ConnectedCities.class.getName());
				logger.log(Level.SEVERE, "Executor did not terminate in the specified time."); //optional *
			    List<Runnable> droppedTasks = executor.shutdownNow(); //optional **
			    logger.log(Level.SEVERE, "Executor was abruptly shut down. " + droppedTasks.size() + " tasks will not be executed."); //optional **
			    System.exit(-1);
			}
		} catch (InterruptedException e1) {
			e1.printStackTrace();
		}
        for (FutureTask<Void> task : futures){
        	try {
				task.get();
			} catch (InterruptedException | ExecutionException e) {
				e.printStackTrace();
			}                
        }
        return ConnectedCities.areCitiesConnected;
    }