ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/jsr166/jsr166/src/test/jtreg/util/Collections/EmptyIterator.java
(Generate patch)

Comparing jsr166/src/test/jtreg/util/Collections/EmptyIterator.java (file contents):
Revision 1.4 by jsr166, Tue Dec 6 04:37:55 2011 UTC vs.
Revision 1.5 by dl, Wed Feb 8 00:01:38 2012 UTC

# Line 60 | Line 60 | public class EmptyIterator {
60      }
61  
62      <T> void testEmptyEnumeration(final Enumeration<T> e) {
63        check(e == emptyEnumeration());
63          check(! e.hasMoreElements());
64          THROWS(NoSuchElementException.class,
65                 new F(){void f(){ e.nextElement(); }});
66      }
67  
68      <T> void testEmptyIterator(final Iterator<T> it) {
70        check(it == emptyIterator());
69          check(! it.hasNext());
70          THROWS(NoSuchElementException.class,
71                 new F(){void f(){ it.next(); }});
# Line 76 | Line 74 | public class EmptyIterator {
74      }
75  
76      void testEmptyMap(Map<Object, Object> m) {
79        check(m == emptyMap());
77          check(m.entrySet().iterator() ==
78                Collections.<Map.Entry<Object,Object>>emptyIterator());
79          check(m.values().iterator() == emptyIterator());
# Line 111 | Line 108 | public class EmptyIterator {
108  
109      <E> void testEmptyCollection(final Collection<E> c) {
110          testEmptyIterator(c.iterator());
114
115        check(c.iterator() == emptyIterator());
116        if (c instanceof List)
117            check(((List<?>)c).listIterator() == emptyListIterator());
118
111          testToArray(c);
112      }
113  

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines