// Path: src/main/java/org/jheaps/AddressableHeap.java
// interface Handle<K, V> {
// 
//     /**
//      * Return the key of the element.
//      *
//      * @return the key of the element
//      */
//     K getKey();
// 
//     /**
//      * Return the value of the element.
//      *
//      * @return the value of the element
//      */
//     V getValue();
// 
//     /**
//      * Set the value of the element.
//      * 
//      * @param value
//      *            the new value
//      */
//     void setValue(V value);
// 
//     /**
//      * Decrease the key of the element.
//      *
//      * @param newKey
//      *            the new key
//      * @throws IllegalArgumentException
//      *             if the new key is larger than the old key according to
//      *             the comparator used when constructing the heap or the
//      *             natural ordering of the elements if no comparator was
//      *             used
//      */
//     void decreaseKey(K newKey);
// 
//     /**
//      * Delete the element from the heap that it belongs.
//      *
//      * @throws IllegalArgumentException
//      *             in case this function is called twice on the same element
//      *             or the element has already been deleted using
//      *             {@link AddressableHeap#deleteMin()}.
//      */
//     void delete();
// 
// }
// 
// Path: src/main/java/org/jheaps/MergeableDoubleEndedAddressableHeap.java
// public interface MergeableDoubleEndedAddressableHeap<K, V> extends DoubleEndedAddressableHeap<K, V> {
// 
//     /**
//      * Meld a heap into the current heap.
//      *
//      * After the operation the {@code other} heap will be empty and will not
//      * permit further insertions.
//      *
//      * @param other
//      *            a merge-able heap
//      * @throws ClassCastException
//      *             if {@code other} is not compatible with this heap
//      * @throws IllegalArgumentException
//      *             if {@code other} does not have a compatible comparator
//      */
//     void meld(MergeableDoubleEndedAddressableHeap<K, V> other);
// 
// }


import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertTrue;
import static org.junit.Assert.fail;
import java.io.Serializable;
import java.util.Comparator;
import org.jheaps.AddressableHeap.Handle;
import org.jheaps.MergeableDoubleEndedAddressableHeap;
import org.junit.BeforeClass;
import org.junit.Test;
/*
 * (C) Copyright 2014-2016, by Dimitrios Michail
 *
 * JHeaps Library
 * 
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package org.jheaps.tree;




public abstract class AbstractMergeableDoubleEndedAddressableHeapTest {

    protected static final int SIZE = 100000;

    private static Comparator<Integer> comparator;

    private static class TestComparator implements Comparator<Integer>, Serializable {
        private static final long serialVersionUID = 1L;

        @Override
        public int compare(Integer o1, Integer o2) {
            if (o1 < o2) {
                return 1;
            } else if (o1 > o2) {
                return -1;
            } else {
                return 0;
            }
        }
    }

    @BeforeClass
    public static void setUpClass() {
        comparator = new TestComparator();
    }

// Path: src/main/java/org/jheaps/AddressableHeap.java
// interface Handle<K, V> {
// 
//     /**
//      * Return the key of the element.
//      *
//      * @return the key of the element
//      */
//     K getKey();
// 
//     /**
//      * Return the value of the element.
//      *
//      * @return the value of the element
//      */
//     V getValue();
// 
//     /**
//      * Set the value of the element.
//      * 
//      * @param value
//      *            the new value
//      */
//     void setValue(V value);
// 
//     /**
//      * Decrease the key of the element.
//      *
//      * @param newKey
//      *            the new key
//      * @throws IllegalArgumentException
//      *             if the new key is larger than the old key according to
//      *             the comparator used when constructing the heap or the
//      *             natural ordering of the elements if no comparator was
//      *             used
//      */
//     void decreaseKey(K newKey);
// 
//     /**
//      * Delete the element from the heap that it belongs.
//      *
//      * @throws IllegalArgumentException
//      *             in case this function is called twice on the same element
//      *             or the element has already been deleted using
//      *             {@link AddressableHeap#deleteMin()}.
//      */
//     void delete();
// 
// }
// 
// Path: src/main/java/org/jheaps/MergeableDoubleEndedAddressableHeap.java
// public interface MergeableDoubleEndedAddressableHeap<K, V> extends DoubleEndedAddressableHeap<K, V> {
// 
//     /**
//      * Meld a heap into the current heap.
//      *
//      * After the operation the {@code other} heap will be empty and will not
//      * permit further insertions.
//      *
//      * @param other
//      *            a merge-able heap
//      * @throws ClassCastException
//      *             if {@code other} is not compatible with this heap
//      * @throws IllegalArgumentException
//      *             if {@code other} does not have a compatible comparator
//      */
//     void meld(MergeableDoubleEndedAddressableHeap<K, V> other);
// 
// }


// Path: src/test/java/org/jheaps/tree/AbstractMergeableDoubleEndedAddressableHeapTest.java
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertTrue;
import static org.junit.Assert.fail;
import java.io.Serializable;
import java.util.Comparator;
import org.jheaps.AddressableHeap.Handle;
import org.jheaps.MergeableDoubleEndedAddressableHeap;
import org.junit.BeforeClass;
import org.junit.Test;

/*
 * (C) Copyright 2014-2016, by Dimitrios Michail
 *
 * JHeaps Library
 * 
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package org.jheaps.tree;




public abstract class AbstractMergeableDoubleEndedAddressableHeapTest {

    protected static final int SIZE = 100000;

    private static Comparator<Integer> comparator;

    private static class TestComparator implements Comparator<Integer>, Serializable {
        private static final long serialVersionUID = 1L;

        @Override
        public int compare(Integer o1, Integer o2) {
            if (o1 < o2) {
                return 1;
            } else if (o1 > o2) {
                return -1;
            } else {
                return 0;
            }
        }
    }

    @BeforeClass
    public static void setUpClass() {
        comparator = new TestComparator();
    }

    protected abstract MergeableDoubleEndedAddressableHeap<Integer, String> createHeap();