class RoundRobinAccessor<T> {

    private final List<T> list;
    private final AtomicInteger index;

    public RoundRobinAccessor(final List<T> list) {
        this(list, new AtomicInteger());
    }

    RoundRobinAccessor(final List<T> list, final AtomicInteger index) {
        this.list = Collections.unmodifiableList(list);
        this.index = index;
    }

    public T get() {<FILL_FUNCTION_BODY>}

}

        // "& Integer.MAX_VALUE" resets the sign should x overflow.
        // https://engineering.atspotify.com/2015/08/underflow-bug/
        return list.get(index.getAndUpdate(x -> (x + 1) & Integer.MAX_VALUE) % list.size());
    
<no_super_class>