<commit_before>package ch.difty.scipamato.common.navigator;

import static java.util.stream.Collectors.toList;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.Collection;
import java.util.List;
import java.util.Objects;
import java.util.concurrent.atomic.AtomicInteger;

import ch.difty.scipamato.common.NullArgumentException;

/**
 * List based implementation of the {@link NavigatedItems} interface.
 *
 * @param <T>
 *     type of the items that are managed. Must implement
 *     {@link Serializable}.
 * @author u.joss
 */
class NavigatedList<T extends Serializable> implements NavigatedItems<T> {
    private static final long serialVersionUID = 1L;

    private final List<T> items = new ArrayList<>();

    @SuppressWarnings("CanBeFinal")
    private volatile AtomicInteger index = new AtomicInteger();

    /**
     * Instantiate the {@link NavigatedList} with the provided collection of items.
     *
     * @param items
     *     collection of items, must not be null or empty.<commit_msg>Fix atomicInteger<commit_after>package ch.difty.scipamato.common.navigator;

import static java.util.stream.Collectors.toList;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.Collection;
import java.util.List;
import java.util.Objects;
import java.util.concurrent.atomic.AtomicInteger;

import ch.difty.scipamato.common.NullArgumentException;

/**
 * List based implementation of the {@link NavigatedItems} interface.
 *
 * @param <T>
 *     type of the items that are managed. Must implement
 *     {@link Serializable}.
 * @author u.joss
 */
class NavigatedList<T extends Serializable> implements NavigatedItems<T> {
    private static final long serialVersionUID = 1L;

    private final List<T> items = new ArrayList<>();

    private final AtomicInteger index = new AtomicInteger();

    /**
     * Instantiate the {@link NavigatedList} with the provided collection of items.
     *
     * @param items
     *     collection of items, must not be null or empty.
{'fraction_non_alphanumeric': 0.0974764967837704, 'fraction_numerical': 0.0009896091044037606, 'mean_word_length': 3.968058968058968, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 13, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '540365', 'n_tokens_mistral': 590, 'n_tokens_neox': 569, 'n_words': 175}