getAlways method

T getAlways(
  1. int index
)

This will always return an element unless the list is empty. In case of overflow, the list will repeat.

Implementation

T getAlways(int index) {
  assert(isNotEmpty, "List should be empty");
  return this[index % length];
}