public Process getNextProcess(Integer processor)
    {
        Process currentProcess = runningProcesses.get(processor);
        if(currentProcess != null)
        {
            Integer timeRemaining = currentProcess.getTimeRemaining(),
                timeTotal = currentProcess.getTimeTotal();
            Boolean preempted = false;
            if(waitingProcesses.size() > 0)
            {
                Process highestPriority = waitingProcesses.get(0);
                if(highestPriority.getPriority() < currentProcess.getPriority())
                {
                    // Get preempted
                    addProcess(currentProcess);
                    runningProcesses.set(processor, null);
                    preempted = true;
                }
            }
            if(!preempted && (timeTotal - timeRemaining) % sliceLength != 0)
            {
                // Continue the current process
                return currentProcess;
            }
            if(!preempted)
            {
                // Otherwise, stick it on the end of the list
                addProcess(currentProcess);
                runningProcesses.set(processor, null);
            }
        }
        if(waitingProcesses.size() == 0) return null;
        return waitingProcesses.remove(0); 
    }