<commit_before>package com.github.davidmoten.logan;

import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;

import java.util.Iterator;
import java.util.Map;

import org.junit.Test;

import com.google.common.collect.Maps;

public class DataTest {

	@Test
	public void testFindWithNoData() {
		Data d = new Data();
		assertEquals(0, d.getNumEntries());
		Iterator<LogEntry> it = d.find(0, 200).iterator();
		assertFalse(it.hasNext());
	}

	@Test
	public void testData() {
		Data d = new Data();
		Map<String, String> map = Maps.newHashMap();
		map.put("n", "123");
		d.add(new LogEntry(100L, map));
		assertEquals(1, d.getNumEntries());
		Iterator<LogEntry> it = d.find(0, 200).iterator();
		assertTrue(it.hasNext());
		assertEquals(100L, it.next().getTime());
		assertFalse(it.hasNext());
	}

	@Test
	public void testData2() {
		Data d = new Data();
		Map<String, String> map = Maps.newHashMap();
		map.put("n", "123");
		d.add(new LogEntry(-10L, map));
		d.add(new LogEntry(100L, map));
		d.add(new LogEntry(230L, map));
		assertEquals(3, d.getNumEntries());
		Iterator<LogEntry> it = d.find(0, 200).iterator();
		assertTrue(it.hasNext());
		assertEquals(100L, it.next().getTime());
		assertFalse(it.hasNext());
	}

}
<commit_msg>add DataTest<commit_after>package com.github.davidmoten.logan;

import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;

import java.util.Iterator;
import java.util.Map;

import org.junit.Test;

import com.google.common.collect.Maps;

public class DataTest {

	@Test
	public void testFindWithNoData() {
		Data d = new Data();
		assertEquals(0, d.getNumEntries());
		Iterator<LogEntry> it = d.find(0, 200).iterator();
		assertFalse(it.hasNext());
	}

	@Test
	public void testFindWithOneEntryBetweenRangeAndNoOtherEntries() {
		Data d = new Data();
		Map<String, String> map = Maps.newHashMap();
		map.put("n", "123");
		d.add(new LogEntry(100L, map));
		assertEquals(1, d.getNumEntries());
		Iterator<LogEntry> it = d.find(0, 200).iterator();
		assertTrue(it.hasNext());
		assertEquals(100L, it.next().getTime());
		assertFalse(it.hasNext());
	}

	@Test
	public void testFindWithThreeEntriesWhereOneEntryIsBetweenRange() {
		Data d = new Data();
		Map<String, String> map = Maps.newHashMap();
		map.put("n", "123");
		d.add(new LogEntry(-10L, map));
		d.add(new LogEntry(100L, map));
		d.add(new LogEntry(230L, map));
		assertEquals(3, d.getNumEntries());
		Iterator<LogEntry> it = d.find(0, 200).iterator();
		assertTrue(it.hasNext());
		assertEquals(100L, it.next().getTime());
		assertFalse(it.hasNext());
	}

}

{'fraction_non_alphanumeric': 0.1697553743513714, 'fraction_numerical': 0.02853965900667161, 'mean_word_length': 4.893013100436681, 'pattern_counts': {'":': 0, '<': 13, '<?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': '1083576', 'n_tokens_mistral': 1050, 'n_tokens_neox': 951, 'n_words': 195}