code: @VisibleForTesting
      int getValueFromList(final List<Integer> values, int index, final AtomicInteger shift) {
          Preconditions.checkNotNullNorEmpty(values, "List must not be empty");
          if (index < 0) {
              index = index + values.size();
              shift.incrementAndGet();
              return getValueFromList(values, index, shift);
          }
          if (index >= values.size()) {
              index = index - values.size();
              shift.incrementAndGet();
              return getValueFromList(values, index, shift);
          }
          return values.get(index);
      }
docs: Obtain value from list considering specified index and required shifts.
  
  @param values - possible values
  @param index  - index to be considered
  @param shift  - shifts that should be applied
  @return int - required value from values list