<commit_before>package won.utils.batch;

import org.junit.Assert;
import org.junit.Test;
import won.utils.batch.BatchingConsumer.Config;
import won.utils.batch.BatchingConsumer.ConfigBuilder;

public class BatchingConsumerTest {
    @Test
    public void testConsumeAllOneKey() {
        BatchingConsumer<String, String> c = new BatchingConsumer<>();
        AtomicInteger counter = new AtomicInteger(0);
        c.accept("key1", "first item", items -> counter.addAndGet(items.size()));
        Assert.assertEquals(0, counter.get());
        c.accept("key1", "second item", items -> counter.set(-1));
        Assert.assertEquals(0, counter.get());
        c.accept("key1", "third item", items -> counter.set(-2));
        Assert.assertEquals(0, counter.get());<commit_msg>Fix build... i hope<commit_after>package won.utils.batch;

import org.junit.Assert;
import org.junit.Test;
import won.utils.batch.BatchingConsumer.Config;
import won.utils.batch.BatchingConsumer.ConfigBuilder;

import java.time.Duration;
import java.util.Collection;
import java.util.concurrent.CountDownLatch;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.atomic.AtomicInteger;

public class BatchingConsumerTest {
    @Test
    public void testConsumeAllOneKey() {
        BatchingConsumer<String, String> c = new BatchingConsumer<>();
        AtomicInteger counter = new AtomicInteger(0);
        c.accept("key1", "first item", items -> counter.addAndGet(items.size()));
        Assert.assertEquals(0, counter.get());
        c.accept("key1", "second item", items -> counter.set(-1));
        Assert.assertEquals(0, counter.get());
        c.accept("key1", "third item", items -> counter.set(-2));
        Assert.assertEquals(0, counter.get());
{'fraction_non_alphanumeric': 0.1437607820586544, 'fraction_numerical': 0.010350776308223116, 'mean_word_length': 3.9714285714285715, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 13, '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': '6101792', 'n_tokens_mistral': 506, 'n_tokens_neox': 497, 'n_words': 106}