Java Code Examples for java.util.Collection#spliterator()
The following examples show how to use
java.util.Collection#spliterator() .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: SpliteratorLateBindingFailFastTest.java From jdk8u-jdk with GNU General Public License v2.0 | 5 votes |
@Test(dataProvider = "Source") public <T> void lateBindingTestWithCharacteritics(String description, Supplier<Source<T>> ss) { Source<T> source = ss.get(); Collection<T> c = source.asCollection(); Spliterator<T> s = c.spliterator(); s.characteristics(); Set<T> r = new HashSet<>(); s.forEachRemaining(r::add); assertEquals(r, new HashSet<>(c)); }
Example 2
Source File: SpliteratorLateBindingFailFastTest.java From openjdk-jdk8u-backup with GNU General Public License v2.0 | 5 votes |
@Test(dataProvider = "Source") public <T> void testFailFastTestWithForEach(String description, Supplier<Source<T>> ss) { Source<T> source = ss.get(); Collection<T> c = source.asCollection(); Spliterator<T> s = c.spliterator(); executeAndCatch(() -> s.forEachRemaining(e -> { source.update(); })); }
Example 3
Source File: SpliteratorLateBindingFailFastTest.java From jdk8u-jdk with GNU General Public License v2.0 | 5 votes |
@Test(dataProvider = "Source") public <T> void testFailFastTestWithForEach(String description, Supplier<Source<T>> ss) { Source<T> source = ss.get(); Collection<T> c = source.asCollection(); Spliterator<T> s = c.spliterator(); executeAndCatch(() -> s.forEachRemaining(e -> { source.update(); })); }
Example 4
Source File: SpliteratorLateBindingFailFastTest.java From openjdk-8-source with GNU General Public License v2.0 | 5 votes |
@Test(dataProvider = "Source") public <T> void lateBindingTestWithForEach(String description, Supplier<Source<T>> ss) { Source<T> source = ss.get(); Collection<T> c = source.asCollection(); Spliterator<T> s = c.spliterator(); source.update(); Set<T> r = new HashSet<>(); s.forEachRemaining(r::add); assertEquals(r, new HashSet<>(c)); }
Example 5
Source File: SpliteratorLateBindingFailFastTest.java From jdk8u_jdk with GNU General Public License v2.0 | 5 votes |
@Test(dataProvider = "Source") public <T> void testFailFastTestWithForEach(String description, Supplier<Source<T>> ss) { Source<T> source = ss.get(); Collection<T> c = source.asCollection(); Spliterator<T> s = c.spliterator(); executeAndCatch(() -> s.forEachRemaining(e -> { source.update(); })); }
Example 6
Source File: SpliteratorLateBindingFailFastTest.java From openjdk-jdk8u with GNU General Public License v2.0 | 5 votes |
@Test(dataProvider = "Source") public <T> void testFailFastTestWithForEach(String description, Supplier<Source<T>> ss) { Source<T> source = ss.get(); Collection<T> c = source.asCollection(); Spliterator<T> s = c.spliterator(); executeAndCatch(() -> s.forEachRemaining(e -> { source.update(); })); }
Example 7
Source File: SpliteratorLateBindingFailFastTest.java From jdk8u-jdk with GNU General Public License v2.0 | 5 votes |
@Test(dataProvider = "Source") public <T> void lateBindingTestWithTryAdvance(String description, Supplier<Source<T>> ss) { Source<T> source = ss.get(); Collection<T> c = source.asCollection(); Spliterator<T> s = c.spliterator(); source.update(); Set<T> r = new HashSet<>(); while (s.tryAdvance(r::add)) { } assertEquals(r, new HashSet<>(c)); }
Example 8
Source File: SpliteratorLateBindingFailFastTest.java From jdk8u-jdk with GNU General Public License v2.0 | 5 votes |
@Test(dataProvider = "Source") public <T> void lateBindingTestWithForEach(String description, Supplier<Source<T>> ss) { Source<T> source = ss.get(); Collection<T> c = source.asCollection(); Spliterator<T> s = c.spliterator(); source.update(); Set<T> r = new HashSet<>(); s.forEachRemaining(r::add); assertEquals(r, new HashSet<>(c)); }
Example 9
Source File: CollectionsTest.java From j2objc with Apache License 2.0 | 5 votes |
private static <V> void check_orderedCollection( Collection<V> collection, List<V> elementsInOrder) { Spliterator<V> spliterator = collection.spliterator(); SpliteratorTester.runBasicIterationTests(spliterator, elementsInOrder); if (spliterator.hasCharacteristics(SIZED)) { SpliteratorTester.runSizedTests(collection, elementsInOrder.size()); } if (spliterator.hasCharacteristics(SUBSIZED)) { SpliteratorTester.runSubSizedTests(collection, elementsInOrder.size()); } SpliteratorTester.runOrderedTests(collection); }
Example 10
Source File: SpliteratorLateBindingFailFastTest.java From jdk8u-jdk with GNU General Public License v2.0 | 5 votes |
@Test(dataProvider = "Source") public <T> void lateBindingTestWithTryAdvance(String description, Supplier<Source<T>> ss) { Source<T> source = ss.get(); Collection<T> c = source.asCollection(); Spliterator<T> s = c.spliterator(); source.update(); Set<T> r = new HashSet<>(); while (s.tryAdvance(r::add)) { } assertEquals(r, new HashSet<>(c)); }
Example 11
Source File: SpliteratorLateBindingFailFastTest.java From hottub with GNU General Public License v2.0 | 5 votes |
@Test(dataProvider = "Source") public <T> void lateBindingTestWithTryAdvance(String description, Supplier<Source<T>> ss) { Source<T> source = ss.get(); Collection<T> c = source.asCollection(); Spliterator<T> s = c.spliterator(); source.update(); Set<T> r = new HashSet<>(); while (s.tryAdvance(r::add)) { } assertEquals(r, new HashSet<>(c)); }
Example 12
Source File: SpliteratorLateBindingFailFastTest.java From hottub with GNU General Public License v2.0 | 5 votes |
@Test(dataProvider = "Source") public <T> void lateBindingTestWithForEach(String description, Supplier<Source<T>> ss) { Source<T> source = ss.get(); Collection<T> c = source.asCollection(); Spliterator<T> s = c.spliterator(); source.update(); Set<T> r = new HashSet<>(); s.forEachRemaining(r::add); assertEquals(r, new HashSet<>(c)); }
Example 13
Source File: SpliteratorLateBindingFailFastTest.java From jdk8u60 with GNU General Public License v2.0 | 5 votes |
@Test(dataProvider = "Source") public <T> void lateBindingTestWithForEach(String description, Supplier<Source<T>> ss) { Source<T> source = ss.get(); Collection<T> c = source.asCollection(); Spliterator<T> s = c.spliterator(); source.update(); Set<T> r = new HashSet<>(); s.forEachRemaining(r::add); assertEquals(r, new HashSet<>(c)); }
Example 14
Source File: SpliteratorLateBindingFailFastTest.java From TencentKona-8 with GNU General Public License v2.0 | 5 votes |
@Test(dataProvider = "Source") public <T> void testFailFastTestWithForEach(String description, Supplier<Source<T>> ss) { Source<T> source = ss.get(); Collection<T> c = source.asCollection(); Spliterator<T> s = c.spliterator(); executeAndCatch(() -> s.forEachRemaining(e -> { source.update(); })); }
Example 15
Source File: SpliteratorLateBindingFailFastTest.java From openjdk-8 with GNU General Public License v2.0 | 5 votes |
@Test(dataProvider = "Source") public <T> void lateBindingTestWithCharacteritics(String description, Supplier<Source<T>> ss) { Source<T> source = ss.get(); Collection<T> c = source.asCollection(); Spliterator<T> s = c.spliterator(); s.characteristics(); Set<T> r = new HashSet<>(); s.forEachRemaining(r::add); assertEquals(r, new HashSet<>(c)); }
Example 16
Source File: SpliteratorLateBindingFailFastTest.java From TencentKona-8 with GNU General Public License v2.0 | 5 votes |
@Test(dataProvider = "Source") public <T> void lateBindingTestWithTryAdvance(String description, Supplier<Source<T>> ss) { Source<T> source = ss.get(); Collection<T> c = source.asCollection(); Spliterator<T> s = c.spliterator(); source.update(); Set<T> r = new HashSet<>(); while (s.tryAdvance(r::add)) { } assertEquals(r, new HashSet<>(c)); }
Example 17
Source File: SpliteratorLateBindingFailFastTest.java From openjdk-8-source with GNU General Public License v2.0 | 5 votes |
@Test(dataProvider = "Source") public <T> void lateBindingTestWithTryAdvance(String description, Supplier<Source<T>> ss) { Source<T> source = ss.get(); Collection<T> c = source.asCollection(); Spliterator<T> s = c.spliterator(); source.update(); Set<T> r = new HashSet<>(); while (s.tryAdvance(r::add)) { } assertEquals(r, new HashSet<>(c)); }
Example 18
Source File: SpliteratorLateBindingFailFastTest.java From jdk8u_jdk with GNU General Public License v2.0 | 5 votes |
@Test(dataProvider = "Source") public <T> void lateBindingTestWithTryAdvance(String description, Supplier<Source<T>> ss) { Source<T> source = ss.get(); Collection<T> c = source.asCollection(); Spliterator<T> s = c.spliterator(); source.update(); Set<T> r = new HashSet<>(); while (s.tryAdvance(r::add)) { } assertEquals(r, new HashSet<>(c)); }
Example 19
Source File: SpliteratorLateBindingFailFastTest.java From dragonwell8_jdk with GNU General Public License v2.0 | 5 votes |
@Test(dataProvider = "Source") public <T> void lateBindingTestWithCharacteritics(String description, Supplier<Source<T>> ss) { Source<T> source = ss.get(); Collection<T> c = source.asCollection(); Spliterator<T> s = c.spliterator(); s.characteristics(); Set<T> r = new HashSet<>(); s.forEachRemaining(r::add); assertEquals(r, new HashSet<>(c)); }
Example 20
Source File: SpliteratorLateBindingFailFastTest.java From jdk8u-jdk with GNU General Public License v2.0 | 5 votes |
@Test(dataProvider = "Source") public <T> void lateBindingTestWithForEach(String description, Supplier<Source<T>> ss) { Source<T> source = ss.get(); Collection<T> c = source.asCollection(); Spliterator<T> s = c.spliterator(); source.update(); Set<T> r = new HashSet<>(); s.forEachRemaining(r::add); assertEquals(r, new HashSet<>(c)); }