<commit_before>package org.jboss.cx.remoting.util;

import java.util.ArrayList;
import java.util.Enumeration;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.NoSuchElementException;
import java.util.Queue;
import java.util.Set;
import java.util.WeakHashMap;
import java.util.Collections;
import java.util.Collection;
import java.util.concurrent.ArrayBlockingQueue;
import java.util.concurrent.BlockingQueue;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.ConcurrentMap;

/**
 * A set of helpful utility functions for collections.
 */
public final class CollectionUtil {
    private CollectionUtil() {
    }

    /**
     * Create a concurrent map instance.
     *
     * @return a new concurrent map
     */
    public static <K, V> ConcurrentMap<K, V> concurrentMap() {
        if (true) {
            return synchronizedHashMap();
        } else {
            return new ConcurrentHashMap<K, V>();
        }
    }

    /**
     * Create a synchronized map that obeys the contract for {@code ConcurrentMap}.
     *
     * @param original the map to be wrapped
     * @return a synchronized map
     */
    public static <K, V> ConcurrentMap<K, V> synchronizedMap(Map<K, V> original) {
        return new SynchronizedMap<K, V>(original);
    }

    /**
     * Create a synchronized hash map that obeys the contract for {@code ConcurrentMap}.
     *
     * @return a synchronized hash map
     */
    public static <K, V> ConcurrentMap<K, V> synchronizedHashMap() {
        return synchronizedMap(CollectionUtil.<K, V>hashMap());
    }

    /**
     * Create an array-backed list.
     *
     * @return an array-backed list
     */
    public static <T> List<T> arrayList() {
        return new ArrayList<T>();
    }

    /**
     * Create a synchronized array-backed list.
     *
     * @return a synchronized array-backed list
     */
    public static <T> List<T> synchronizedArrayList() {
        return Collections.synchronizedList(CollectionUtil.<T>arrayList());
    }

    /**
     * Create an array-backed list whose contents are a copy of the given list.
     *<commit_msg>Add linkedList method<commit_after>package org.jboss.cx.remoting.util;

import java.util.ArrayList;
import java.util.Enumeration;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.NoSuchElementException;
import java.util.Queue;
import java.util.Set;
import java.util.WeakHashMap;
import java.util.Collections;
import java.util.Collection;
import java.util.LinkedList;
import java.util.concurrent.ArrayBlockingQueue;
import java.util.concurrent.BlockingQueue;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.ConcurrentMap;

/**
 * A set of helpful utility functions for collections.
 */
public final class CollectionUtil {
    private CollectionUtil() {
    }

    /**
     * Create a concurrent map instance.
     *
     * @return a new concurrent map
     */
    public static <K, V> ConcurrentMap<K, V> concurrentMap() {
        if (true) {
            return synchronizedHashMap();
        } else {
            return new ConcurrentHashMap<K, V>();
        }
    }

    /**
     * Create a synchronized map that obeys the contract for {@code ConcurrentMap}.
     *
     * @param original the map to be wrapped
     * @return a synchronized map
     */
    public static <K, V> ConcurrentMap<K, V> synchronizedMap(Map<K, V> original) {
        return new SynchronizedMap<K, V>(original);
    }

    /**
     * Create a synchronized hash map that obeys the contract for {@code ConcurrentMap}.
     *
     * @return a synchronized hash map
     */
    public static <K, V> ConcurrentMap<K, V> synchronizedHashMap() {
        return synchronizedMap(CollectionUtil.<K, V>hashMap());
    }

    /**
     * Create an array-backed list.
     *
     * @return an array-backed list
     */
    public static <T> List<T> arrayList() {
        return new ArrayList<T>();
    }

    /**
     * Create a linked list.
     *
     * @return a linked list
     */
    public static <T> LinkedList<T> linkedList() {
        return new LinkedList<T>();
    }

    /**
     * Create a synchronized array-backed list.
     *
     * @return a synchronized array-backed list
     */
    public static <T> List<T> synchronizedArrayList() {
        return Collections.synchronizedList(CollectionUtil.<T>arrayList());
    }

    /**
     * Create an array-backed list whose contents are a copy of the given list.
     *
{'fraction_non_alphanumeric': 0.10831889081455806, 'fraction_numerical': 0.0, 'mean_word_length': 2.747564935064935, 'pattern_counts': {'":': 0, '<': 38, '<?xml version=': 0, '>': 38, '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': '4939981', 'n_tokens_mistral': 1337, 'n_tokens_neox': 1315, 'n_words': 388}