public Process getNextProcess(Integer processor)
    {
        Process currentProcess = runningProcesses.get(processor);
        if(currentProcess != null && preemption == false)
        {
            return currentProcess;
        }
        if(waitingProcesses.size() == 0)
        {
            return null;
        }

        Integer shortestProcess = 0;
        Integer shortestTime = waitingProcesses.get(0).getTimeRemaining();
        for(Integer i = 0; i < waitingProcesses.size(); ++i)
        {
            Process process = waitingProcesses.get(i);
            if(process.getTimeRemaining() < shortestTime)
            {
                shortestTime = process.getTimeRemaining();
                shortestProcess = i;
            }
        }
        if(currentProcess != null && preemption)
        {
            if(shortestTime < currentProcess.getTimeRemaining())
            {
                addProcess(currentProcess);
                runningProcesses.set(processor, null);
            } else {
                return currentProcess;
            }
        }
        return waitingProcesses.remove((int) shortestProcess);
    }