/libcore/ojluni/src/test/java/util/stream/test/org/openjdk/tests/java/util/stream/ |
D | IntSliceOpTest.java | 74 … exerciseOps(IntStream.range(1, 2).toArray(), s -> s.skip(0), IntStream.range(1, 2).toArray()); in testSkip() 75 exerciseOps(IntStream.range(1, 2).toArray(), s -> s.skip(1), EMPTY_INT_ARRAY); in testSkip() 76 … exerciseOps(IntStream.range(1, 101).toArray(), s -> s.skip(0), IntStream.range(1, 101).toArray()); in testSkip() 77 …exerciseOps(IntStream.range(1, 101).toArray(), s -> s.skip(10), IntStream.range(11, 101).toArray()… in testSkip() 78 exerciseOps(IntStream.range(1, 101).toArray(), s -> s.skip(100), EMPTY_INT_ARRAY); in testSkip() 79 exerciseOps(IntStream.range(1, 101).toArray(), s -> s.skip(200), EMPTY_INT_ARRAY); in testSkip() 96 exerciseOps(IntStream.range(1, 2).toArray(), s -> s.limit(0), EMPTY_INT_ARRAY); in testLimit() 97 … exerciseOps(IntStream.range(1, 2).toArray(), s -> s.limit(1), IntStream.range(1, 2).toArray()); in testLimit() 98 exerciseOps(IntStream.range(1, 101).toArray(), s -> s.limit(0), EMPTY_INT_ARRAY); in testLimit() 99 …exerciseOps(IntStream.range(1, 101).toArray(), s -> s.limit(10), IntStream.range(1, 11).toArray()); in testLimit() [all …]
|
D | DoublePrimitiveOpsTests.java | 47 double[] array = LongStream.range(1, 10).asDoubleStream().map(i -> i * 2).toArray(); in testToArray() 52 … double[] array = LongStream.range(1, 10).parallel().asDoubleStream().map(i -> i * 2).toArray(); in testToArray() 60 double[] content = DoubleStream.generate(() -> r.nextDouble()).limit(10).toArray(); in testSort() 65 double[] array = Arrays.stream(content).sorted().toArray(); in testSort() 70 double[] array = Arrays.stream(content).parallel().sorted().toArray(); in testSort() 78 double[] content = DoubleStream.generate(() -> r.nextDouble()).limit(10).toArray(); in testSortSort() 83 double[] array = Arrays.stream(content).sorted().sorted().toArray(); in testSortSort() 88 double[] array = Arrays.stream(content).parallel().sorted().sorted().toArray(); in testSortSort() 97 double[] actual = DoubleStream.iterate(1.0, i -> i + 1.0).limit(9).toArray(); in testLimit() 102 … double[] actual = LongStream.range(1, 100).parallel().asDoubleStream().limit(9).toArray(); in testLimit()
|
D | ToArrayOpTest.java | 55 assertCountSum(Arrays.asList(countTo(0).stream().toArray()), 0, 0); in testToArray() 56 assertCountSum(Arrays.asList(countTo(10).stream().toArray()), 10, 55); in testToArray() 61 exerciseTerminalOps(data, s -> s.toArray()); in testOps() 69 …Object[] objects = exerciseTerminalOps(data, s -> s.map(i -> (Integer) (i + i)), s -> s.toArray()); in testOpsWithMap() 78 Object[] objects = exerciseTerminalOps(data, s -> s.sorted(), s -> s.toArray()); in testOpsWithSorted() 89 s -> s.toArray()); in testOpsWithFlatMap() 98 exerciseTerminalOps(data, s -> s.filter(LambdaTestHelpers.pEven), s -> s.toArray()); in testOpsWithFilter() 108 s -> s.toArray(Integer[]::new)); in testAsArrayWithType() 122 exerciseTerminalOps(data, f, s -> s.toArray()); in testDistinctAndSortedPermutations() 124 Integer[] is = exerciseTerminalOps(data, f, s -> s.toArray(Integer[]::new)); in testDistinctAndSortedPermutations() [all …]
|
D | LongPrimitiveOpsTests.java | 90 long[] array = LongStream.range(1, 10).map(i -> i * 2).toArray(); in testToArray() 95 long[] array = LongStream.range(1, 10).parallel().map(i -> i * 2).toArray(); in testToArray() 103 long[] content = LongStream.generate(() -> r.nextLong()).limit(10).toArray(); in testSort() 108 long[] array = Arrays.stream(content).sorted().toArray(); in testSort() 113 long[] array = Arrays.stream(content).parallel().sorted().toArray(); in testSort() 121 long[] content = LongStream.generate(() -> r.nextLong()).limit(10).toArray(); in testSortSort() 126 long[] array = Arrays.stream(content).sorted().sorted().toArray(); in testSortSort() 131 long[] array = Arrays.stream(content).parallel().sorted().sorted().toArray(); in testSortSort() 138 long[] expected = LongStream.range(1, 1000).toArray(); in testSequential() 170 long[] expected = LongStream.range(1, 10).toArray(); in testLimit() [all …]
|
D | IntPrimitiveOpsTests.java | 90 int[] array = IntStream.range(1, 10).map(i -> i * 2).toArray(); in testToArray() 95 int[] array = IntStream.range(1, 10).parallel().map(i -> i * 2).toArray(); in testToArray() 103 int[] content = IntStream.generate(() -> r.nextInt(100)).limit(10).toArray(); in testSort() 108 int[] array = Arrays.stream(content).sorted().toArray(); in testSort() 113 int[] array = Arrays.stream(content).parallel().sorted().toArray(); in testSort() 121 int[] content = IntStream.generate(() -> r.nextInt(100)).limit(10).toArray(); in testSortSort() 126 int[] array = Arrays.stream(content).sorted().sorted().toArray(); in testSortSort() 131 int[] array = Arrays.stream(content).parallel().sorted().sorted().toArray(); in testSortSort() 138 int[] expected = IntStream.range(1, 1000).toArray(); in testSequential() 170 int[] expected = IntStream.range(1, 10).toArray(); in testLimit() [all …]
|
/libcore/luni/src/test/java/libcore/java/util/stream/ |
D | MapMultiTest.java | 67 int[] result = Stream.of(10, 20, 30).mapMultiToInt(intToId).toArray(); in testMapMultiToInt_toId() 74 long[] result = Stream.of(10L, 20L, 30L).mapMultiToLong(longToId).toArray(); in testMapMultiToLong_toId() 81 double[] result = Stream.of(10.0, 20.0, 30.0).mapMultiToDouble(doubleToId).toArray(); in testMapMultiToDouble_toId() 88 int[] result = Stream.of(10, 20, 30).mapMultiToInt(intDevNull).toArray(); in testMapMultiToInt_noopSink() 95 long[] result = Stream.of(10L, 20L, 30L).mapMultiToLong(longDevNull).toArray(); in testMapMultiToLong_noopSink() 102 double[] result = Stream.of(10.0, 20.0, 30.0).mapMultiToDouble(doubleDevNull).toArray(); in testMapMultiToDouble_noopSink() 109 int[] flattened = Stream.of(List.of(10, 20, 30)).mapMultiToInt(intListFlattener).toArray(); in testMapMultiToInt_flattenToList() 117 Stream.of(List.of(10L, 20L, 30L)).mapMultiToLong(longListFlattener).toArray(); in testMapMultiToLong_flattenToList() 127 .toArray(); in testMapMultiToDouble_flattenToList()
|
D | StreamTest.java | 52 String[] array = Stream.of(object).toArray(String[]::new); in streamOfSingleObject() 64 .toArray(String[]::new); in streamOfObjects() 77 assertArrayEquals(new Integer[] {10}, Stream.ofNullable(10).toArray()); in ofNullable_ofNonNull()
|
/libcore/luni/src/test/java/libcore/java/lang/ |
D | StringBufferTest.java | 31 assertTrue(Arrays.equals(expected, s.chars().toArray())); in testChars() 36 assertTrue(Arrays.equals(new int[]{high, low, low}, surrogateCP.chars().toArray())); in testChars() 45 assertTrue(Arrays.equals(expected, s.codePoints().toArray())); in testCodePoints() 50 assertEquals(Character.toCodePoint(high, low), surrogateCP.codePoints().toArray()[0]); in testCodePoints() 51 assertEquals((int) low, surrogateCP.codePoints().toArray()[1]); // Unmatched surrogate. in testCodePoints() 52 assertEquals((int) '0', surrogateCP.codePoints().toArray()[2]); in testCodePoints()
|
D | StringBuilderTest.java | 141 assertTrue(Arrays.equals(expected, s.chars().toArray())); in testChars() 146 assertTrue(Arrays.equals(new int[]{high, low, low}, surrogateCP.chars().toArray())); in testChars() 155 assertTrue(Arrays.equals(expected, s.codePoints().toArray())); in testCodePoints() 160 assertEquals(Character.toCodePoint(high, low), surrogateCP.codePoints().toArray()[0]); in testCodePoints() 161 assertEquals((int) low, surrogateCP.codePoints().toArray()[1]); // Unmatched surrogate. in testCodePoints() 162 assertEquals((int) '0', surrogateCP.codePoints().toArray()[2]); in testCodePoints()
|
/libcore/luni/src/test/java/libcore/java/util/ |
D | RandomTest.java | 54 int[] streamRands = new Random(0).ints().limit(limit).toArray(); in test_ints$() 67 int[] streamRands = new Random(0).ints(size).toArray(); in test_ints$L() 87 int[] streamRands = new Random(0).ints(origin, bound).limit(limit).toArray(); in test_ints$II() 106 int[] streamRands = new Random(0).ints(size, origin, bound).toArray(); in test_ints$LII() 129 long[] streamRands = new Random(0).longs().limit(limit).toArray(); in test_longs$() 142 long[] streamRands = new Random(0).longs(size).toArray(); in test_longs$L() 162 long[] streamRands = new Random(0).longs(origin, bound).limit(limit).toArray(); in test_longs$II() 181 long[] streamRands = new Random(0).longs(size, origin, bound).toArray(); in test_longs$LII() 204 double[] streamRands = new Random(0).doubles().limit(limit).toArray(); in test_doubles$() 217 double[] streamRands = new Random(0).doubles(size).toArray(); in test_doubles$L() [all …]
|
/libcore/ojluni/src/test/java/util/IdentityHashMap/ |
D | ToArray.java | 63 Object[] mArray = m.entrySet().toArray(); in main() 76 if (es.toArray().length != 0) in main() 78 if (es.toArray(new Object[]{Boolean.TRUE})[0] != null) in main() 81 if (es.toArray().length != 1) in main() 83 Object[] x = es.toArray(new Object[]{Boolean.TRUE, Boolean.TRUE}); in main()
|
/libcore/luni/src/test/java/libcore/java/nio/ |
D | CharBufferTest.java | 36 assertTrue(Arrays.equals(expected, cb.chars().limit(s.length()).toArray())); in testChars() 46 assertTrue(Arrays.equals(expected, cb.codePoints().limit(s.length()).toArray())); in testCodePoints() 53 assertEquals(Character.toCodePoint(high, low), cb.codePoints().toArray()[0]); in testCodePoints() 54 assertEquals((int) low, cb.codePoints().toArray()[1]); // Unmatched surrogate. in testCodePoints() 55 assertEquals((int) '0', cb.codePoints().toArray()[2]); in testCodePoints()
|
/libcore/ojluni/src/test/java/util/stream/boottest/java/util/stream/ |
D | SliceSpliteratorTest.java | 77 … Spliterator<Integer> s = Arrays.spliterator(source.stream().toArray(Integer[]::new)); in sliceSpliteratorDataProvider() 90 … Spliterator.OfInt s = Arrays.spliterator(source.stream().mapToInt(i->i).toArray()); in sliceSpliteratorDataProvider() 103 … Spliterator.OfLong s = Arrays.spliterator(source.stream().mapToLong(i->i).toArray()); in sliceSpliteratorDataProvider() 116 … Spliterator.OfDouble s = Arrays.spliterator(source.stream().mapToDouble(i->i).toArray()); in sliceSpliteratorDataProvider() 133 … Spliterator<Integer> s = Arrays.spliterator(source.stream().toArray(Integer[]::new)); in sliceSpliteratorDataProvider() 147 … Spliterator.OfInt s = Arrays.spliterator(source.stream().mapToInt(i->i).toArray()); in sliceSpliteratorDataProvider() 161 … Spliterator.OfLong s = Arrays.spliterator(source.stream().mapToLong(i->i).toArray()); in sliceSpliteratorDataProvider() 175 … Spliterator.OfDouble s = Arrays.spliterator(LongStream.range(0, SIZE).asDoubleStream().toArray()); in sliceSpliteratorDataProvider() 183 return data.toArray(new Object[0][]); in sliceSpliteratorDataProvider()
|
D | FlagOpTest.java | 110 …er, Stream<Integer>> data = TestData.Factory.ofArray("Array", countTo(10).toArray(new Integer[0])); in testFlagsClearAllSet() 112 FlagDeclaringOp[] opsArray = ops.toArray(new FlagDeclaringOp[ops.size()]); in testFlagsClearAllSet() 149 …er, Stream<Integer>> data = TestData.Factory.ofArray("Array", countTo(10).toArray(new Integer[0])); in testFlagsSetAllClear() 151 FlagDeclaringOp[] opsArray = ops.toArray(new FlagDeclaringOp[ops.size()]); in testFlagsSetAllClear() 183 …er, Stream<Integer>> data = TestData.Factory.ofArray("Array", countTo(10).toArray(new Integer[0])); in testFlagsSetSequence() 185 IntermediateTestOp[] opsArray = ops.toArray(new IntermediateTestOp[ops.size()]); in testFlagsSetSequence() 219 …er, Stream<Integer>> data = TestData.Factory.ofArray("Array", countTo(10).toArray(new Integer[0])); in testFlagsClearSequence() 221 IntermediateTestOp[] opsArray = ops.toArray(new IntermediateTestOp[ops.size()]); in testFlagsClearSequence() 245 …er, Stream<Integer>> data = TestData.Factory.ofArray("Array", countTo(10).toArray(new Integer[0])); in testFlagsSizedOrderedParallelCollect() 247 IntermediateTestOp[] opsArray = ops.toArray(new IntermediateTestOp[ops.size()]); in testFlagsSizedOrderedParallelCollect()
|
/libcore/ojluni/src/main/java/java/util/ |
D | Collection.java | 322 Object[] toArray(); in toArray() method 375 <T> T[] toArray(T[] a); in toArray() method 412 default <T> T[] toArray(IntFunction<T[]> generator) { in toArray() method 413 return toArray(generator.apply(0)); in toArray()
|
/libcore/harmony-tests/src/test/java/org/apache/harmony/tests/java/util/ |
D | AbstractCollectionTest.java | 247 Object[] array = ac.toArray(); in test_toArray() 288 ac.toArray((Object[]) null); in test_toArray$Ljava_lang_Object() 295 ac.toArray(new StringBuffer[ac.size()]); in test_toArray$Ljava_lang_Object() 302 assertSame(a, ac.toArray(a)); in test_toArray$Ljava_lang_Object() 305 assertNotSame(a, ac.toArray(a)); in test_toArray$Ljava_lang_Object() 306 a = ac.toArray(a); in test_toArray$Ljava_lang_Object() 310 ac.toArray(csa); in test_toArray$Ljava_lang_Object()
|
/libcore/support/src/test/java/tests/support/ |
D | Support_MapTest.java | 135 T[] set1TypedArray1 = set1.toArray(zeroLengthArray); in crossCheckOrdering() 159 T[] set1TypedArray2 = set1.toArray(parameterArray1); in crossCheckOrdering() 164 Object[] set1UntypedArray = set1.toArray(); in crossCheckOrdering() 169 T[] set2TypedArray1 = set2.toArray(zeroLengthArray); in crossCheckOrdering() 175 T[] set2TypedArray2 = set1.toArray(parameterArray2); in crossCheckOrdering() 180 Object[] set2UntypedArray = set2.toArray(); in crossCheckOrdering()
|
/libcore/jsr166-tests/src/test/java/jsr166/ |
D | CopyOnWriteArraySetTest.java | 312 Object[] a = new CopyOnWriteArraySet().toArray(); in testToArray() 322 assertTrue(Arrays.equals(elements, full.toArray())); in testToArray() 323 assertSame(Object[].class, full.toArray().getClass()); in testToArray() 335 assertSame(a, empty.toArray(a)); in testToArray2() 339 assertSame(a, empty.toArray(a)); in testToArray2() 351 assertTrue(Arrays.equals(elements, full.toArray(a))); in testToArray2() 354 assertSame(Integer[].class, full.toArray(a).getClass()); in testToArray2() 358 assertSame(a, full.toArray(a)); in testToArray2() 363 assertSame(a, full.toArray(a)); in testToArray2() 379 c.toArray(new Long[5]); in testToArray_ArrayStoreException() [all …]
|
/libcore/ojluni/src/test/java/util/concurrent/tck/ |
D | CopyOnWriteArraySetTest.java | 334 Object[] a = new CopyOnWriteArraySet().toArray(); in testToArray() 344 assertTrue(Arrays.equals(elements, full.toArray())); in testToArray() 345 assertSame(Object[].class, full.toArray().getClass()); in testToArray() 357 assertSame(a, empty.toArray(a)); in testToArray2() 361 assertSame(a, empty.toArray(a)); in testToArray2() 373 assertTrue(Arrays.equals(elements, full.toArray(a))); in testToArray2() 376 assertSame(Integer[].class, full.toArray(a).getClass()); in testToArray2() 380 assertSame(a, full.toArray(a)); in testToArray2() 385 assertSame(a, full.toArray(a)); in testToArray2() 401 c.toArray(new Long[5]); in testToArray_ArrayStoreException() [all …]
|
/libcore/ojluni/src/test/java/util/HashMap/ |
D | ToArray.java | 83 T[] res = collection.toArray(inputArray); in checkToTypedArray() 115 Object[] objects = collection.toArray(); in checkToObjectArray() 136 checkToArray(i + "-keys", keys.toArray(new String[0]), map.keySet(), !ordered); in checkMap() 137 checkToArray(i + "-values", values.toArray(new String[0]), map.values(), !ordered); in checkMap() 156 … checkToArray("100", LongStream.range(0, 100).boxed().toArray(Long[]::new), longSet, !ordered); in checkSet() 163 .toArray(Long[]::new), longSet, !ordered); in checkSet()
|
/libcore/ojluni/src/test/java/util/EnumMap/ |
D | ToArray.java | 46 Object[] z = m.entrySet().toArray(); in testToArray() 52 Map.Entry[] x2 = m.entrySet().toArray(x1); in testToArray() 59 Map.Entry[] y2 = m.entrySet().toArray(y1); in testToArray()
|
/libcore/ojluni/src/main/java/java/util/concurrent/ |
D | CopyOnWriteArraySet.java | 176 public Object[] toArray() { in toArray() method in CopyOnWriteArraySet 177 return al.toArray(); in toArray() 221 public <T> T[] toArray(T[] a) { in toArray() method in CopyOnWriteArraySet 222 return al.toArray(a); in toArray()
|
D | DelayQueue.java | 404 public Object[] toArray() { in toArray() method in DelayQueue 408 return q.toArray(); in toArray() 449 public <T> T[] toArray(T[] a) { in toArray() method in DelayQueue 453 return q.toArray(a); in toArray() 502 return new Itr(toArray()); in iterator()
|
/libcore/ojluni/src/test/java/util/Collections/ |
D | NCopies.java | 72 check(x.toArray().length == 0); in checkEmpty() 73 check(x.toArray().getClass() == Object[].class); in checkEmpty() 80 check(x.toArray().length == x.size()); in checkFoos() 81 check(x.toArray().getClass() == Object[].class); in checkFoos() 82 String[] sa = x.toArray(new String[x.size()]); in checkFoos()
|
/libcore/ojluni/src/test/java/util/Map/ |
D | ToArray.java | 85 Object[] keys = map.keySet().toArray(); in testMap() 93 Object[] values = map.values().toArray(); in testMap() 101 Map.Entry<Integer,Long>[] entries = map.entrySet().toArray(new Map.Entry[TEST_SIZE]); in testMap()
|