@Test
public void testIterator() {

        IntegerUnion mergeTool = new IntegerUnion();
        Set<Integer> origin = new TreeSet<Integer>();
        for (int i = 51; i < 60; i++) {
                mergeTool.add(i);
                origin.add(i);
        }
        for (int i = 75; i < 80; i++) {
                mergeTool.add(i);
                origin.add(i);
        }
        for (int i = 65; i < 74; i++) {
                mergeTool.add(i);
                origin.add(i);
        }
        Iterator<Integer> itMerge = mergeTool.iterator();
        Iterator<Integer> itOrigin = origin.iterator();
        while (itMerge.hasNext()) {
                Integer mergeValue = itMerge.next();
                Integer originValue = itOrigin.next();
                if (!mergeValue.equals(originValue)) {
                        Assert.assertTrue(mergeValue + "!=" + originValue, mergeValue.equals(originValue));
                }
        }
        Assert.assertTrue(itMerge.hasNext() == itOrigin.hasNext());
}