<commit_before>package de.itemis.mosig.ringbuffer;

import java.util.Random;

import org.junit.Assert;
import org.junit.Test;

public class CircularBufferTest {

	@Test
	public void whenPassingRandomNbrToTheConstructorSizeShouldBeThatNbr() {
		int expectedSize = generateRandomIntInRangeZeroToMax();
		CircularBuffer underTest = createTestBuffer(expectedSize);
		Assert.assertEquals(expectedSize, underTest.size());
	}

	@Test
	public void countShouldReturnZeroIfBufferIsEmpty() {
		CircularBuffer underTest = createTestBuffer(3);
		Assert.assertEquals(0, underTest.count());
	}

	private CircularBuffer createTestBuffer(int expectedSize) {
		return new CircularBuffer(expectedSize);
	}

	private int generateRandomIntInRangeZeroToMax() {
		return new Random().nextInt(Integer.MAX_VALUE);
	}
}<commit_msg>RED: New test using non existing add method.<commit_after>package de.itemis.mosig.ringbuffer;

import java.util.Random;

import org.junit.Assert;
import org.junit.Test;

public class CircularBufferTest {

	@Test
	public void whenPassingRandomNbrToTheConstructorSizeShouldBeThatNbr() {
		int expectedSize = generateRandomIntInRangeZeroToMax();
		CircularBuffer underTest = createTestBuffer(expectedSize);
		Assert.assertEquals(expectedSize, underTest.size());
	}

	@Test
	public void countShouldReturnZeroIfBufferIsEmpty() {
		CircularBuffer underTest = createTestBuffer(3);
		Assert.assertEquals(0, underTest.count());
	}

	@Test
	public void countShouldReturnOneWhenAddingAnElementToAnEmptyBuffer() {
		CircularBuffer underTest = createTestBuffer(3);
		underTest.add();
	}

	private CircularBuffer createTestBuffer(int expectedSize) {
		return new CircularBuffer(expectedSize);
	}

	private int generateRandomIntInRangeZeroToMax() {
		return new Random().nextInt(Integer.MAX_VALUE);
	}
}
{'fraction_non_alphanumeric': 0.09090909090909091, 'fraction_numerical': 0.002788622420524261, 'mean_word_length': 6.634042553191489, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '264209', 'n_tokens_mistral': 557, 'n_tokens_neox': 529, 'n_words': 105}