/*
 * @author Ranides Atterwim <ranides@gmail.com>
 * @copyright Ranides Atterwim
 * @license WTFPL
 * @url http://ranides.net/projects/assira
 */
package net.ranides.assira.collection.rmq;

import java.io.Serializable;
import java.util.Arrays;
import java.util.function.Function;
import net.ranides.assira.ContractTesters;
import net.ranides.assira.functional.Fold;
import net.ranides.assira.generic.CompareUtils;
import net.ranides.assira.test.TCollection;
import org.junit.Test;
import static org.junit.Assert.*;

/**
 *
 * @author Ranides Atterwim <ranides@gmail.com>
 */
public class RMQTreeTest {
    
    private final TCollection<String> $list = RMQTester.NUMBERS;
    
    private final Function<int[], RMQList> $make = array -> {
        RMQTree<String> ret = new RMQTree<>((Fold<String> & Serializable)(a, b) -> CompareUtils.higher(RMQTester.NUMBERS.comparator(), a, b));
        ret.addAll(Arrays.asList($list.list(array).values()));
        return ret;
    };
    
    @Test
    public void testSuite() {
        assertTrue(ContractTesters.runner()
            .param("collection!", $list)
            .ignore("ListTester.basicAddAllAt")
            .ignore("ListTester.basicAddAt")
            .ignore("ListTester.basicClear")
            .ignore("ListTester.basicClearAdd")
            .ignore("ListTester.basicIterator_Add")
            .ignore("ListTester.basicIterator_Remove")
            .ignore("ListTester.basicIterator_Set")
            .ignore("ListTester.basicRemove")
			.ignore("ListTester.basicRemoveRetainAll")
            .ignore("ListTester.basicRemoveIndex")
            .ignore("ListTester.basicSet")
            .ignore("ListTester.basicSublist_add")
            .ignore("ListTester.basicSublist_addAll")
            .ignore("ListTester.basicSublist_clear")
            .ignore("ListTester.basicSublist_clearAdd")
            .ignore("ListTester.basicSublist_set")
            .ignore("ListTester.nestedSublistTest")

            .ignore("CollectionTester.basicRemove") 
            .ignore("CollectionTester.basicRetainAll") 
            .function(new int[0], $make)
			.run()
        );
    }
    
}
