core/src/main/java/com/orientechnologies/orient/core/db/record/ridbag/embedded/OEmbeddedRidBag.java
public boolean swap(int index, OIdentifiable newValue) {
    EntriesIterator iter = (EntriesIterator) rawIterator();
    int currIndex = 0;
    while (iter.hasNext()) {
      iter.next();
      if (index == currIndex) {
        iter.swapValueOnCurrent(newValue);
        return true;
      }
      currIndex++;
    }
    return false;
  }
public boolean swap(int index, OIdentifiable newValue) {
    EntriesIterator iter = (EntriesIterator) rawIterator();
    int currIndex = 0;
    while (iter.hasNext()) {
      iter.next();
      if (index == currIndex) {
        iter.swapValueOnCurrent(newValue);
        return true;
      }
      currIndex++;
    }
    return false;
  }
for internal use only

@param index
@param newValue

@return