<commit_before>package no.priv.bang.modeling.modelstore.impl;

import static org.junit.Assert.*;

import java.util.List;
import static no.priv.bang.modeling.modelstore.impl.Values.*;
import no.priv.bang.modeling.modelstore.Value;
import no.priv.bang.modeling.modelstore.ValueList;
import org.junit.Before;
import org.junit.Test;

/**
 * Unit tests for {@link EmptyValueList}.
 *
 * @author <NAME>
 *
 */
public class EmptyValueListTest {

    private ValueList list;

    @Before
    public void setUp() throws Exception {
        list = new EmptyValueList();
    }

    @Test
    public void testAdd() {
        assertFalse(list.add((Value)null));
        assertEquals(0, list.size());
        list.add(1024, null);
        assertEquals(0, list.size());
        list.add(Boolean.TRUE);
        assertEquals(0, list.size());
        list.add(true);
        assertEquals(0, list.size());
        list.add(Long.valueOf(3));
        assertEquals(0, list.size());
        list.add(37);
        assertEquals(0, list.size());
        list.add(Double.valueOf(3.14));
        assertEquals(0, list.size());
        list.add(2.78);
        assertEquals(0, list.size());
        list.add("foo");
        assertEquals(0, list.size());
        list.add(new PropertysetImpl());
        assertEquals(0, list.size());
        list.add(newList());
        assertEquals(0, list.size());
    }

    @Test
    public void testAddAll() {
        assertFalse(list.addAll(new EmptyValueList()));
        assertFalse(list.addAll(0, new EmptyValueList()));
    }

    @Test
    public void testContains() {
        assertFalse(list.contains(null));
    }

    @Test
    public void testContainsAll() {
        assertTrue(list.containsAll(new EmptyValueList()));
    }

    @Test
    public void testGet() {
        assertEquals(getNil(), list.get(135));
    }

    @Test
    public void testIndexOf() {
        assertEquals(-1, list.indexOf(null));
    }

    @Test
    public void testIsEmpty() {
        assertTrue(list.isEmpty());
    }

    @Test
    public void testIterator() {
        assertNotNull(list.iterator());
    }

    @Test
    public void testLastIndexOf() {
        assertEquals(-1, list.lastIndexOf(null));
    }

    @Test
    public void testListIterator() {
        assertNotNull(list.listIterator());
    }

    @Test(expected=IndexOutOfBoundsException.class)
    public void testListIteratorWithArg() {
        assertNotNull(list.listIterator(135));
    }

    @Test
    public void testRemove() {
        assertFalse(list.remove(null));
        assertEquals(getNil(), list.remove(135));
    }

    @Test
    public void testRemoveAll() {
        assertFalse(list.removeAll(null));
    }

    @Test
    public void testRetainAll() {
        assertFalse(list.retainAll(null));
    }

    @Test
    public void testSet() {
        assertEquals(getNil(), list.set(135, (Value)null));
        assertEquals(getNil(), list.set(135, Boolean.TRUE));
        assertEquals(getNil(), list.set(135, true));
        assertEquals(getNil(), list.set(135, Long.valueOf(1)));
        assertEquals(getNil(), list.set(135, 2));
        assertEquals(getNil(), list.set(135, Double.valueOf(1.1)));
        assertEquals(getNil(), list.set(135, 2.4));
        assertEquals(getNil(), list.set(135, "foobar"));
        assertEquals(getNil(), list.set(135, new PropertysetImpl()));
        assertEquals(getNil(), list.set(135, newList()));
    }

    @Test
    public void testSize() {
        assertEquals(0, list.size());
    }

    @Test(expected=IndexOutOfBoundsException.class)
    public void testSubList() {
        List<Value> sublist = list.subList(1, 2);<commit_msg>Fixed unit tess for Java 1.8: AbstractCollection methods no longer accepts null arguments.<commit_after>package no.priv.bang.modeling.modelstore.impl;

import static org.junit.Assert.*;

import java.util.Collections;
import java.util.List;
import static no.priv.bang.modeling.modelstore.impl.Values.*;
import no.priv.bang.modeling.modelstore.Value;
import no.priv.bang.modeling.modelstore.ValueList;
import org.junit.Before;
import org.junit.Test;

/**
 * Unit tests for {@link EmptyValueList}.
 *
 * @author <NAME>
 *
 */
public class EmptyValueListTest {

    private ValueList list;

    @Before
    public void setUp() throws Exception {
        list = new EmptyValueList();
    }

    @Test
    public void testAdd() {
        assertFalse(list.add((Value)null));
        assertEquals(0, list.size());
        list.add(1024, null);
        assertEquals(0, list.size());
        list.add(Boolean.TRUE);
        assertEquals(0, list.size());
        list.add(true);
        assertEquals(0, list.size());
        list.add(Long.valueOf(3));
        assertEquals(0, list.size());
        list.add(37);
        assertEquals(0, list.size());
        list.add(Double.valueOf(3.14));
        assertEquals(0, list.size());
        list.add(2.78);
        assertEquals(0, list.size());
        list.add("foo");
        assertEquals(0, list.size());
        list.add(new PropertysetImpl());
        assertEquals(0, list.size());
        list.add(newList());
        assertEquals(0, list.size());
    }

    @Test
    public void testAddAll() {
        assertFalse(list.addAll(new EmptyValueList()));
        assertFalse(list.addAll(0, new EmptyValueList()));
    }

    @Test
    public void testContains() {
        assertFalse(list.contains(null));
    }

    @Test
    public void testContainsAll() {
        assertTrue(list.containsAll(new EmptyValueList()));
    }

    @Test
    public void testGet() {
        assertEquals(getNil(), list.get(135));
    }

    @Test
    public void testIndexOf() {
        assertEquals(-1, list.indexOf(null));
    }

    @Test
    public void testIsEmpty() {
        assertTrue(list.isEmpty());
    }

    @Test
    public void testIterator() {
        assertNotNull(list.iterator());
    }

    @Test
    public void testLastIndexOf() {
        assertEquals(-1, list.lastIndexOf(null));
    }

    @Test
    public void testListIterator() {
        assertNotNull(list.listIterator());
    }

    @Test(expected=IndexOutOfBoundsException.class)
    public void testListIteratorWithArg() {
        assertNotNull(list.listIterator(135));
    }

    @Test
    public void testRemove() {
        assertFalse(list.remove(null));
        assertEquals(getNil(), list.remove(135));
    }

    @Test
    public void testRemoveAll() {
        assertFalse(list.removeAll(Collections.emptyList()));
    }

    @Test
    public void testRetainAll() {
        assertFalse(list.retainAll(Collections.emptyList()));
    }

    @Test
    public void testSet() {
        assertEquals(getNil(), list.set(135, (Value)null));
        assertEquals(getNil(), list.set(135, Boolean.TRUE));
        assertEquals(getNil(), list.set(135, true));
        assertEquals(getNil(), list.set(135, Long.valueOf(1)));
        assertEquals(getNil(), list.set(135, 2));
        assertEquals(getNil(), list.set(135, Double.valueOf(1.1)));
        assertEquals(getNil(), list.set(135, 2.4));
        assertEquals(getNil(), list.set(135, "foobar"));
        assertEquals(getNil(), list.set(135, new PropertysetImpl()));
        assertEquals(getNil(), list.set(135, newList()));
    }

    @Test
    public void testSize() {
        assertEquals(0, list.size());
    }

    @Test(expected=IndexOutOfBoundsException.class)
    public void testSubList() {
        List<Value> sublist = list.subList(1, 2);
{'fraction_non_alphanumeric': 0.14748153122901275, 'fraction_numerical': 0.020416386836803222, 'mean_word_length': 2.73607626693427, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, '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': '3756682', 'n_tokens_mistral': 2311, 'n_tokens_neox': 2191, 'n_words': 419}