// 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;
      return forwardIterator.previous();
    }

    @Override
    public int nextIndex() {
      return reversePosition(forwardIterator.nextIndex());
    }

    @Override
    public T previous() {
      if (!hasPrevious()) {
        throw new NoSuchElementException();
      }
      canRemoveOrSet = true;
      return forwardIterator.next();
    }

    @Override
    public int previousIndex() {
      return nextIndex() - 1;
    }

    @Override
    public void remove() {
      forwardIterator.remove();
      canRemoveOrSet = false;
    }

    @Override
    public void set(T e) {
// 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;

      return forwardIterator.previous();
    }

    @Override
    public int nextIndex() {
      return reversePosition(forwardIterator.nextIndex());
    }

    @Override
    public T previous() {
      if (!hasPrevious()) {
        throw new NoSuchElementException();
      }
      canRemoveOrSet = true;
      return forwardIterator.next();
    }

    @Override
    public int previousIndex() {
      return nextIndex() - 1;
    }

    @Override
    public void remove() {
      forwardIterator.remove();
      canRemoveOrSet = false;
    }

    @Override
    public void set(T e) {
      checkState(canRemoveOrSet);