<commit_before>import java.util.ArrayList;
import java.util.List;

public class MergeSort<T extends Comparable<T>> implements Sort<T> {

    @Override
    public List<T> sort(List<T> list) {
        if (list == null)
            throw new NullPointerException();
        if (list.size() == 0)
            throw new IndexOutOfBoundsException();
        if (list.size() == 1)
            return new ArrayList<>(list);

        mergeSort(list, 0, list.size() - 1);
        return list;
    }

    private void mergeSort(List<T> list, int start, int end) {
        if (end - start < 0)
            throw new NullPointerException();
        if (end - start == 0) {
            return;
        }
        if (end - start == 1) {;
            if (list.get(start).compareTo(list.get(end)) > 0) {
                swap(list, start, end);
            }
            return;
        }

        int middle = (end + start) >>> 1;

        if (end - start > 1) {
            mergeSort(list, start, middle);<commit_msg>formatting<commit_after>import java.util.ArrayList;
import java.util.List;

public class MergeSort<T extends Comparable<T>> implements Sort<T> {

    @Override
    public List<T> sort(List<T> list) {
        if (list == null)
            throw new NullPointerException();
        if (list.size() == 0)
            throw new IndexOutOfBoundsException();
        if (list.size() == 1)
            return new ArrayList<>(list);

        mergeSort(list, 0, list.size() - 1);

        return list;
    }

    private void mergeSort(List<T> list, int start, int end) {
        if (end - start < 0)
            throw new NullPointerException();
        if (end - start == 0) {
            return;
        }
        if (end - start == 1) {;
            if (list.get(start).compareTo(list.get(end)) > 0) {
                swap(list, start, end);
            }
            return;
        }

        int middle = (end + start) >>> 1;

        if (end - start > 1) {
            mergeSort(list, start, middle);
{'fraction_non_alphanumeric': 0.132, 'fraction_numerical': 0.01, 'mean_word_length': 1.7261580381471389, 'pattern_counts': {'":': 0, '<': 19, '<?xml version=': 0, '>': 27, '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': '6924562', 'n_tokens_mistral': 615, 'n_tokens_neox': 583, 'n_words': 165}