if (!_elements.isEmpty()) { Change changes = null; synchronized(_elements) { changes = (Change)_elements.remove(0); }
if(changes != null) {
        public void run() {            boolean run = true;            while (true) {                try {                    if(_elements.isEmpty()) {                        wait(10);                    }                } catch (InterruptedException e) {                    run = false;                    log.info("Interrupted: " + e, e);                }                if (!_elements.isEmpty()) {                    Change changes = null;                    synchronized(_elements) {                        changes = (Change)_elements.remove(0);                    }                    EOObjectStoreCoordinator sender = changes.coordinator();                      process(sender, _deleteProcessor, changes.deleted());                    process(sender, _insertProcessor, changes.inserted());                    process(sender, _updateProcessor, changes.updated());                }            }        }