// Path: src/main/java/com/fernandocejas/arrow/checks/Preconditions.java
// public static int checkElementIndex(int index, int size) {
//   return checkElementIndex(index, size, "index");
// }
// 
// Path: src/main/java/com/fernandocejas/arrow/checks/Preconditions.java
// public static <T> T checkNotNull(T reference) {
//   if (reference == null) {
//     throw new NullPointerException();
//   }
//   return reference;
// }
// 
// Path: src/main/java/com/fernandocejas/arrow/checks/Preconditions.java
// public static int checkPositionIndex(int index, int size) {
//   return checkPositionIndex(index, size, "index");
// }
// 
// Path: src/main/java/com/fernandocejas/arrow/checks/Preconditions.java
// public static void checkPositionIndexes(int start, int end, int size) {
//   // Carefully optimized for execution by hotspot (explanatory comment above)
//   if (start < 0 || end < start || end > size) {
//     throw new IndexOutOfBoundsException(badPositionIndexes(start, end, size));
//   }
// }
// 
// Path: src/main/java/com/fernandocejas/arrow/checks/Preconditions.java
// public static void checkState(boolean expression) {
//   if (!expression) {
//     throw new IllegalStateException();
//   }
// }


import java.util.AbstractList;
import java.util.Iterator;
import java.util.List;
import java.util.ListIterator;
import java.util.NoSuchElementException;
import org.jetbrains.annotations.Nullable;
import static com.fernandocejas.arrow.checks.Preconditions.checkElementIndex;
import static com.fernandocejas.arrow.checks.Preconditions.checkNotNull;
import static com.fernandocejas.arrow.checks.Preconditions.checkPositionIndex;
import static com.fernandocejas.arrow.checks.Preconditions.checkPositionIndexes;
import static com.fernandocejas.arrow.checks.Preconditions.checkState;
    forwardList.clear();
  }

  @Override
  public T remove(int index) {
    return forwardList.remove(reverseIndex(index));
  }

  @Override
  protected void removeRange(int fromIndex, int toIndex) {
    subList(fromIndex, toIndex).clear();
  }

  @Override
  public T set(int index, @Nullable T element) {
    return forwardList.set(reverseIndex(index), element);
  }

  @Override
  public T get(int index) {
    return forwardList.get(reverseIndex(index));
  }

  @Override
  public int size() {
    return forwardList.size();
  }

  @Override
  public List<T> subList(int fromIndex, int toIndex) {
// Path: src/main/java/com/fernandocejas/arrow/checks/Preconditions.java
// public static int checkElementIndex(int index, int size) {
//   return checkElementIndex(index, size, "index");
// }
// 
// Path: src/main/java/com/fernandocejas/arrow/checks/Preconditions.java
// public static <T> T checkNotNull(T reference) {
//   if (reference == null) {
//     throw new NullPointerException();
//   }
//   return reference;
// }
// 
// Path: src/main/java/com/fernandocejas/arrow/checks/Preconditions.java
// public static int checkPositionIndex(int index, int size) {
//   return checkPositionIndex(index, size, "index");
// }
// 
// Path: src/main/java/com/fernandocejas/arrow/checks/Preconditions.java
// public static void checkPositionIndexes(int start, int end, int size) {
//   // Carefully optimized for execution by hotspot (explanatory comment above)
//   if (start < 0 || end < start || end > size) {
//     throw new IndexOutOfBoundsException(badPositionIndexes(start, end, size));
//   }
// }
// 
// Path: src/main/java/com/fernandocejas/arrow/checks/Preconditions.java
// public static void checkState(boolean expression) {
//   if (!expression) {
//     throw new IllegalStateException();
//   }
// }


// Path: src/main/java/com/fernandocejas/arrow/collections/ReverseList.java
import java.util.AbstractList;
import java.util.Iterator;
import java.util.List;
import java.util.ListIterator;
import java.util.NoSuchElementException;
import org.jetbrains.annotations.Nullable;
import static com.fernandocejas.arrow.checks.Preconditions.checkElementIndex;
import static com.fernandocejas.arrow.checks.Preconditions.checkNotNull;
import static com.fernandocejas.arrow.checks.Preconditions.checkPositionIndex;
import static com.fernandocejas.arrow.checks.Preconditions.checkPositionIndexes;
import static com.fernandocejas.arrow.checks.Preconditions.checkState;

    forwardList.clear();
  }

  @Override
  public T remove(int index) {
    return forwardList.remove(reverseIndex(index));
  }

  @Override
  protected void removeRange(int fromIndex, int toIndex) {
    subList(fromIndex, toIndex).clear();
  }

  @Override
  public T set(int index, @Nullable T element) {
    return forwardList.set(reverseIndex(index), element);
  }

  @Override
  public T get(int index) {
    return forwardList.get(reverseIndex(index));
  }

  @Override
  public int size() {
    return forwardList.size();
  }

  @Override
  public List<T> subList(int fromIndex, int toIndex) {
    checkPositionIndexes(fromIndex, toIndex, size());