/*
 * @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.function.Function;
import net.ranides.assira.collection.lists.NativeArrayList;
import net.ranides.assira.ContractTesters;
import net.ranides.assira.collection.mockup.TMaps;
import net.ranides.assira.functional.IntFold;
import net.ranides.assira.test.TCollection;
import org.junit.Test;
import static org.junit.Assert.*;

/**
 *
 * @author Ranides Atterwim <ranides@gmail.com>
 */
public class IntRMQTreeTest {
    
    private final TCollection<Integer> $list = TMaps.MAP_IS.keys();
    
    private final Function<int[], IntRMQList> $make = array -> {
        IntRMQTree ret = new IntRMQTree((IntFold & Serializable)Math::max);
        ret.addAll(NativeArrayList.wrap($list.list(array).valuesInt()));
        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("IntListTester.basicAddAllAt_Collection")
            .ignore("IntListTester.basicAddAllAt_List")
            .ignore("IntListTester.basicAddElements")
			.ignore("IntListTester.basicRemoveRetainAll")
            .ignore("IntListTester.basicRemoveElements")
            .ignore("IntListTester.basicStackPop")
            .ignore("IntListTester.basicStackPush")
            .ignore("IntListTester.basicStackPeek")
                
            .ignore("CollectionTester.basicRemove") 
            .ignore("CollectionTester.basicRetainAll") 
                
            .ignore("IntCollectionTester.basicRemove")
            .ignore("IntCollectionTester.basicRetainAll")
            .function(new int[0], $make)
			.run()
        );
    }
    
}
