<commit_before>package com.splicemachine.utils;

import com.google.common.collect.Iterables;
import junit.framework.Assert;
import org.junit.Test;

import java.util.Arrays;
import java.util.List;

/**
 * @author <NAME>
 *         Date: 25/10/2013
 */
public class PartitionTest {

    public static List testColl = Arrays.asList(10, 20, 30, 40, 50, 60);

    public static List l(Object... args){ return Arrays.asList(args);}

    @Test
    public void testPartitions() throws Exception {
        Assert.assertEquals(l(Iterables.toArray(Partition.partition(testColl, 2), Object.class)),
                l(l(10, 20),
                  l(30, 40),
                  l(50, 60)));

        Assert.assertEquals(l(Iterables.toArray(Partition.partition(testColl, 2, 1), Object.class)),
                l(l(10, 20),
                  l(20, 30),
                  l(30, 40),
                  l(40, 50),
                  l(50, 60),
                  l(60)));

        Assert.assertEquals(l(Iterables.toArray(Partition.partition(testColl, 2, 1, true), Object.class)),
                l(l(10, 20),
                  l(20, 30),
                  l(30, 40),
                  l(40, 50),
                  l(50, 60),
                  l(60, null)));

        Assert.assertEquals(l(Iterables.toArray(Partition.partition(testColl, 2, 3, true), Object.class)),
                l(l(10, 20),
                  l(40, 50)));

        Assert.assertEquals(l(Iterables.toArray(Partition.partition(testColl, 3, 4, true), Object.class)),
                l(l(10, 20, 30),
                  l(50, 60, null)));

        Assert.assertEquals(l(Iterables.toArray(Partition.partition(testColl, 3, 4), Object.class)),<commit_msg>Removed deprecation warning, junit.framework.Assert -> org.junit.Assert.<commit_after>package com.splicemachine.utils;

import com.google.common.collect.Iterables;
import java.util.Arrays;
import java.util.List;
import org.junit.Assert;
import org.junit.Test;

/**
 * @author <NAME>
 *         Date: 25/10/2013
 */
public class PartitionTest {

    public static List testColl = Arrays.asList(10, 20, 30, 40, 50, 60);

    public static List l(Object... args){ return Arrays.asList(args);}

    @Test
    public void testPartitions() throws Exception {
        Assert.assertEquals(l(Iterables.toArray(Partition.partition(testColl, 2), Object.class)),
                l(l(10, 20),
                        l(30, 40),
                        l(50, 60)));

        Assert.assertEquals(l(Iterables.toArray(Partition.partition(testColl, 2, 1), Object.class)),
                l(l(10, 20),
                  l(20, 30),
                  l(30, 40),
                  l(40, 50),
                  l(50, 60),
                  l(60)));

        Assert.assertEquals(l(Iterables.toArray(Partition.partition(testColl, 2, 1, true), Object.class)),
                l(l(10, 20),
                  l(20, 30),
                  l(30, 40),
                  l(40, 50),
                  l(50, 60),
                  l(60, null)));

        Assert.assertEquals(l(Iterables.toArray(Partition.partition(testColl, 2, 3, true), Object.class)),
                l(l(10, 20),
                  l(40, 50)));

        Assert.assertEquals(l(Iterables.toArray(Partition.partition(testColl, 3, 4, true), Object.class)),
                l(l(10, 20, 30),
                  l(50, 60, null)));

        Assert.assertEquals(l(Iterables.toArray(Partition.partition(testColl, 3, 4), Object.class)),
{'fraction_non_alphanumeric': 0.1447596988998263, 'fraction_numerical': 0.06079907353792704, 'mean_word_length': 1.9304495335029686, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 6, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '378758', 'n_tokens_mistral': 1235, 'n_tokens_neox': 1015, 'n_words': 217}