<commit_before>package linkedlists;

import datastructures.ListNode;
import org.junit.jupiter.api.Test;

import static linkedlists.LinkedListUtil.assertSameList;
import static linkedlists.LinkedListUtil.createLinkedList;
import static linkedlists.ListPivot.pivot;

class ListPivotTest {

    private ListNode<Integer> expected;
    private ListNode<Integer> input;
    private int k;

    @Test
    void pivot1() {
        expected = createLinkedList(1);
        input = createLinkedList(1);
        k = 0;

        test(expected, input, k);
    }

    @Test
    void pivot2() {
        expected = createLinkedList(1, 1, 1, 3, 3, 3, 2, 2, 2);
        input = createLinkedList(3, 3, 3, 2, 2, 2, 1, 1, 1);
        k = 1;

        test(expected, input, k);
    }

    @Test
    void pivot3() {
        expected = createLinkedList(3, 3, 3, 2, 2, 2, 1, 1, 1);
        input = createLinkedList(1, 1, 1, 2, 2, 2, 3, 3, 3);
        k = 2;

        test(expected, input, k);
    }

    @Test
    void pivot4() {
        expected = createLinkedList(3, 2, 2, 5, 7, 11, 11);
        input = createLinkedList(3, 2, 2, 11, 7, 5, 11);
        k = 7;

        test(expected, input, k);
    }

    private void test(ListNode<Integer> expected, ListNode<Integer> input, int k) {
        assertSameList(expected, pivot(input, k));
    }

}<commit_msg>Fixed pivot test cases<commit_after>package linkedlists;

import datastructures.ListNode;
import org.junit.jupiter.api.Test;

import static linkedlists.LinkedListUtil.assertSameList;
import static linkedlists.LinkedListUtil.createLinkedList;
import static linkedlists.ListPivot.pivot;

class ListPivotTest {

    private ListNode<Integer> expected;
    private ListNode<Integer> input;
    private int k;

    @Test
    void pivot1() {
        expected = createLinkedList(1);
        input = createLinkedList(1);
        k = 0;

        test(expected, input, k);
    }

    @Test
    void pivot2() {
        expected = createLinkedList(1, 1, 1, 3, 3, 3, 2, 2, 2);
        input = createLinkedList(3, 3, 3, 2, 2, 2, 1, 1, 1);
        k = 1;

        test(expected, input, k);
    }

    @Test
    void pivot3() {
        expected = createLinkedList(1, 1, 1, 2, 2, 2, 3, 3, 3);
        input = createLinkedList(3, 3, 3, 2, 2, 2, 1, 1, 1);
        k = 2;

        test(expected, input, k);
    }

    @Test
    void pivot4() {
        expected = createLinkedList(3, 2, 2, 5, 7, 11, 11);
        input = createLinkedList(3, 2, 2, 11, 7, 5, 11);
        k = 7;

        test(expected, input, k);
    }

    private void test(ListNode<Integer> expected, ListNode<Integer> input, int k) {
        assertSameList(expected, pivot(input, k));
    }

}
{'fraction_non_alphanumeric': 0.12719790497568276, 'fraction_numerical': 0.04788627010849233, 'mean_word_length': 2.4908616187989554, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 11, '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': '7231208', 'n_tokens_mistral': 1027, 'n_tokens_neox': 888, 'n_words': 261}