/** Returns a process if it is changeable by the entity and has the given process number. */ public Process getProcess(Identity owner, int processID) { synchronized (mProcesses) { if (mProcesses != null) { for (Process process : mProcesses) { if (process.getID() == processID) { // do we filter for owners? if (owner != null) { // check if the entities are the same if (process.isChangableBy(owner)) { return process; } } else { return process; } } } } } return null; }