<commit_before>import org.junit.Test;
import org.mockito.internal.util.collections.ArrayUtils;

import java.util.List;

import static org.junit.Assert.*;

public class SearchSortedTest {

    private int n;
    private int k;

    @Test
    public void search1() throws Exception {
        n = 10;
        k = 5;

        test(n,k);
    }

    @Test
    public void search2() throws Exception {
        n = 50;
        k = 20;

        test(n,k);
    }

    @Test
    public void search3() throws Exception {
        n = 100;
        k = 73;

        test(n,k);
    }

    @Test
    public void search4() throws Exception {
        n = 100;
        k = 1;

        test(n,k);
    }

    @Test
    public void search5() throws Exception {
        n = 100;
        k = 100;

        test(n,k);
    }

    public void test(int n, int k) throws Exception {
        List<Integer> list = StreamUtil.sequence(n);
        assertEquals(list.indexOf(k), SearchSorted.search(list, k));
    }

}<commit_msg>12.1 test fixed for out of bounds index<commit_after>import org.junit.Test;
import org.mockito.internal.util.collections.ArrayUtils;

import java.util.List;

import static org.junit.Assert.*;

public class SearchSortedTest {

    private int n;
    private int k;

    @Test
    public void search1() throws Exception {
        n = 10;
        k = 5;

        test(n,k);
    }

    @Test
    public void search2() throws Exception {
        n = 50;
        k = 20;

        test(n,k);
    }

    @Test
    public void search3() throws Exception {
        n = 100;
        k = 73;

        test(n,k);
    }

    @Test
    public void search4() throws Exception {
        n = 100;
        k = 1;

        test(n,k);
    }

    @Test
    public void search5() throws Exception {
        n = 100;
        k = 99;

        test(n,k);
    }

    public void test(int n, int k) throws Exception {
        List<Integer> list = StreamUtil.sequence(n);
        assertEquals(list.indexOf(k), SearchSorted.search(list, k));
    }

}
{'fraction_non_alphanumeric': 0.11166253101736973, 'fraction_numerical': 0.027791563275434243, 'mean_word_length': 1.8117154811715481, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, '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': '4546127', 'n_tokens_mistral': 704, 'n_tokens_neox': 634, 'n_words': 181}