view src/test/java/jp/ac/u_ryukyu/ie/cr/data/treemap/TreeNodeIteratorTest.java @ 0:44465893e8b8

first Commit
author Kazuma
date Wed, 30 Nov 2016 01:47:55 +0900
parents
children
line wrap: on
line source

package jp.ac.u_ryukyu.ie.cr.data.treemap;

import jp.ac.u_ryukyu.ie.cr.jungle.data.treemap.TreeMap;
import junit.framework.Assert;
import org.junit.Test;

import java.util.Iterator;

/**
 * Created by e115731 on 15/05/06.
 */
public class TreeNodeIteratorTest {
    @Test
    public void getKeyTest() {
        TreeMap<Integer, Integer> map = new TreeMap();
        for (int attributeMaxCount = 10; attributeMaxCount < 1000; attributeMaxCount = attributeMaxCount + 10) {
            for (int count = 0; count < attributeMaxCount; count++) { //insertData
                map = map.put(count, count);
            }
            Iterator<Integer> it = map.keys();
            int iteratorCount = 0;
            while (it.hasNext()) { // count return iterator Attribute Count
                iteratorCount++;
                System.out.println(it.next());
            }
            Assert.assertTrue(iteratorCount == attributeMaxCount); // check
        }

    }
}