protected T removeImpl(int sublistIndex, int sublistOffset) {
    T result;
    if (sublistIndex < headSublistIndex + (calculateSublistsUsed() >>> 1)) {
      CircularListInternal<T> prev = sublists.get(sublistIndex);
      result = prev.remove(sublistOffset);
      size -= 1;
      for (int j = sublistIndex - 1; j >= headSublistIndex; j--) {
        CircularListInternal<T> next = sublists.get(j);
        prev.addHead(next.removeTail());
        prev = next;
      }
      freeCapacityHead += 1;
      if (sublists.get(headSublistIndex).isEmpty()) {
        if (headSublistIndex < tailSublistIndex) {
          headSublistIndex += 1;
          if (headSublistIndex == tailSublistIndex) {
            freeCapacityHead += sublists.get(tailSublistIndex)
                .calculateFreeCapacity();
          }
        }
        shrinkHead();
      }
    } else {
      CircularListInternal<T> prev = sublists.get(sublistIndex);
      result = prev.remove(sublistOffset);
      size -= 1;
      if (sublistIndex <= headSublistIndex) {
        freeCapacityHead += 1;
      }
      for (int j = sublistIndex + 1; j <= tailSublistIndex; j++) {
        CircularListInternal<T> next = sublists.get(j);
        prev.addTail(next.removeHead());
        prev = next;
      }
      if (sublists.get(tailSublistIndex).isEmpty()) {
        tailSublistIndex = Math.max(headSublistIndex, tailSublistIndex - 1);
        shrinkTail();
      }
    }
    assert checkListState(false, false);
    return result;
  }