private void addEntry(Entry entry) {
        int entryObjNum = entry.getReference().getObjectNumber();
        int index = entries.size();
        while (index > 0) {
            Entry prev = entries.get(index-1);
            int prevObjNum = prev.getReference().getObjectNumber();
            if (prevObjNum == entryObjNum) {
                // StateManager is allowing double entries for same reference
                throw new IllegalArgumentException(
                    "Multiple entries with same object number: " + entryObjNum);
            }
            else if (prevObjNum < entryObjNum)
                break;
            index--;
        }
        entries.add(index, entry);
    }