Package org.apache.commons.collections.primitives

Examples of org.apache.commons.collections.primitives.LongIterator


    // tests
    // ------------------------------------------------------------------------

    public final void testLongIteratorNotModifiable() {
        LongIterator iter = makeUnmodifiableLongIterator();
        assertTrue(iter.hasNext());
        iter.next();
        try {
            iter.remove();
            fail("Expected UnsupportedOperationException");
        } catch(UnsupportedOperationException e) {
            // expected
        }
    }
View Full Code Here


            // expected
        }
    }

    public final void testIterateLongIterator() {       
        LongIterator iter = makeUnmodifiableLongIterator();
        for(LongIterator expected = makeLongIterator(); expected.hasNext(); ) {
            assertTrue(iter.hasNext());
            assertEquals(expected.next(),iter.next());
        }
        assertTrue(! iter.hasNext() );
    }
View Full Code Here

            if(this == that) {
                return true;
            } else if(this.size() != that.size()) {
                return false;           
            } else {
                LongIterator thisiter = iterator();
                LongIterator thatiter = that.iterator();
                while(thisiter.hasNext()) {
                    if(thisiter.next() != thatiter.next()) {
                        return false;
                    }
                }
                return true;
            }
View Full Code Here

    public void testWrapNull() {
        assertNull(UnmodifiableLongIterator.wrap(null));
    }

    public void testWrapUnmodifiableLongIterator() {
        LongIterator iter = makeUnmodifiableLongIterator();
        assertSame(iter,UnmodifiableLongIterator.wrap(iter));
    }
View Full Code Here

TOP

Related Classes of org.apache.commons.collections.primitives.LongIterator

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.