public synchronized boolean isEmpty() {
    if (randomAccessContainer == null) {
      if (changes == null) {
        return true;
      }
      if (!hasRemovals) {
        return length == 0;
      }
    }
    // todo we can calculate isEmpty in more cases (without container)
    RandomAccessIntContainer intContainer = getRandomAccessContainer();
    return intContainer.size() == 0;
  }
public synchronized boolean isEmpty()