Java Code Examples for java.util.NavigableSet#toArray()
The following examples show how to use
java.util.NavigableSet#toArray() .
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: ConcurrentSkipListSubSetTest.java From j2objc with Apache License 2.0 | 5 votes |
/** * toArray(a) contains all elements in sorted order */ public void testToArray2() { NavigableSet<Integer> q = populatedSet(SIZE); Integer[] ints = new Integer[SIZE]; Integer[] array = q.toArray(ints); assertSame(ints, array); for (int i = 0; i < ints.length; i++) assertSame(ints[i], q.pollFirst()); }
Example 2
Source File: BTreeMapSubSetTest.java From scava with Eclipse Public License 2.0 | 5 votes |
/** * toArray(a) contains all elements in sorted order */ public void testToArray2() { NavigableSet<Integer> q = populatedSet(SIZE); Integer[] ints = new Integer[SIZE]; Integer[] array = q.toArray(ints); assertSame(ints, array); for (int i = 0; i < ints.length; i++) assertSame(ints[i], q.pollFirst()); }
Example 3
Source File: TreeSubSetTest.java From openjdk-jdk9 with GNU General Public License v2.0 | 5 votes |
/** * toArray contains all elements in sorted order */ public void testToArray() { NavigableSet q = populatedSet(SIZE); Object[] o = q.toArray(); for (int i = 0; i < o.length; i++) assertSame(o[i], q.pollFirst()); }
Example 4
Source File: TreeSubSetTest.java From openjdk-jdk9 with GNU General Public License v2.0 | 5 votes |
/** * toArray(a) contains all elements in sorted order */ public void testToArray2() { NavigableSet<Integer> q = populatedSet(SIZE); Integer[] ints = new Integer[SIZE]; Integer[] array = q.toArray(ints); assertSame(ints, array); for (int i = 0; i < ints.length; i++) assertSame(ints[i], q.pollFirst()); }
Example 5
Source File: TreeSubSetTest.java From openjdk-jdk9 with GNU General Public License v2.0 | 5 votes |
/** * toArray contains all elements */ public void testDescendingToArray() { NavigableSet q = populatedSet(SIZE); Object[] o = q.toArray(); Arrays.sort(o); for (int i = 0; i < o.length; i++) assertEquals(o[i], q.pollFirst()); }
Example 6
Source File: ConcurrentSkipListSubSetTest.java From openjdk-jdk9 with GNU General Public License v2.0 | 5 votes |
/** * toArray contains all elements in sorted order */ public void testToArray() { NavigableSet q = populatedSet(SIZE); Object[] o = q.toArray(); for (int i = 0; i < o.length; i++) assertSame(o[i], q.pollFirst()); }
Example 7
Source File: ConcurrentSkipListSubSetJUnitTest.java From gemfirexd-oss with Apache License 2.0 | 5 votes |
/** * toArray contains all elements */ public void testDescendingToArray() { NavigableSet q = populatedSet(SIZE); Object[] o = q.toArray(); Arrays.sort(o); for (int i = 0; i < o.length; i++) assertEquals(o[i], q.pollFirst()); }
Example 8
Source File: ConcurrentSkipListSubSetJUnitTest.java From gemfirexd-oss with Apache License 2.0 | 5 votes |
/** * toArray(a) contains all elements in sorted order */ public void testToArray2() { NavigableSet<Integer> q = populatedSet(SIZE); Integer[] ints = new Integer[SIZE]; Integer[] array = q.toArray(ints); assertSame(ints, array); for (int i = 0; i < ints.length; i++) assertSame(ints[i], q.pollFirst()); }
Example 9
Source File: ConcurrentSkipListSubSetTest.java From j2objc with Apache License 2.0 | 5 votes |
/** * toArray contains all elements in sorted order */ public void testToArray() { NavigableSet q = populatedSet(SIZE); Object[] o = q.toArray(); for (int i = 0; i < o.length; i++) assertSame(o[i], q.pollFirst()); }
Example 10
Source File: BTreeSet2Test.java From scava with Eclipse Public License 2.0 | 5 votes |
/** * toArray contains all elements in sorted order */ public void testToArray() { NavigableSet q = populatedSet(SIZE); Object[] o = q.toArray(); for (int i = 0; i < o.length; i++) assertSame(o[i], q.pollFirst()); }
Example 11
Source File: BTreeMapSubSetTest.java From scava with Eclipse Public License 2.0 | 5 votes |
/** * toArray contains all elements in sorted order */ public void testToArray() { NavigableSet q = populatedSet(SIZE); Object[] o = q.toArray(); for (int i = 0; i < o.length; i++) assertSame(o[i], q.pollFirst()); }
Example 12
Source File: EmptyNavigableSet.java From openjdk-8 with GNU General Public License v2.0 | 3 votes |
/** * Tests that the array has a size of 0. */ @Test(dataProvider = "NavigableSet<?>", dataProviderClass = EmptyNavigableSet.class) public void testToArray(String description, NavigableSet<?> navigableSet) { Object[] emptyNavigableSetArray = navigableSet.toArray(); assertTrue(emptyNavigableSetArray.length == 0, "Returned non-empty Array."); emptyNavigableSetArray = new Object[20]; Object[] result = navigableSet.toArray(emptyNavigableSetArray); assertSame(emptyNavigableSetArray, result); assertTrue(result[0] == null); }
Example 13
Source File: EmptyNavigableSet.java From dragonwell8_jdk with GNU General Public License v2.0 | 3 votes |
/** * Tests that the array has a size of 0. */ @Test(dataProvider = "NavigableSet<?>", dataProviderClass = EmptyNavigableSet.class) public void testToArray(String description, NavigableSet<?> navigableSet) { Object[] emptyNavigableSetArray = navigableSet.toArray(); assertTrue(emptyNavigableSetArray.length == 0, "Returned non-empty Array."); emptyNavigableSetArray = new Object[20]; Object[] result = navigableSet.toArray(emptyNavigableSetArray); assertSame(emptyNavigableSetArray, result); assertTrue(result[0] == null); }
Example 14
Source File: EmptyNavigableSet.java From jdk8u_jdk with GNU General Public License v2.0 | 3 votes |
/** * Tests that the array has a size of 0. */ @Test(dataProvider = "NavigableSet<?>", dataProviderClass = EmptyNavigableSet.class) public void testToArray(String description, NavigableSet<?> navigableSet) { Object[] emptyNavigableSetArray = navigableSet.toArray(); assertTrue(emptyNavigableSetArray.length == 0, "Returned non-empty Array."); emptyNavigableSetArray = new Object[20]; Object[] result = navigableSet.toArray(emptyNavigableSetArray); assertSame(emptyNavigableSetArray, result); assertTrue(result[0] == null); }
Example 15
Source File: EmptyNavigableSet.java From hottub with GNU General Public License v2.0 | 3 votes |
/** * Tests that the array has a size of 0. */ @Test(dataProvider = "NavigableSet<?>", dataProviderClass = EmptyNavigableSet.class) public void testToArray(String description, NavigableSet<?> navigableSet) { Object[] emptyNavigableSetArray = navigableSet.toArray(); assertTrue(emptyNavigableSetArray.length == 0, "Returned non-empty Array."); emptyNavigableSetArray = new Object[20]; Object[] result = navigableSet.toArray(emptyNavigableSetArray); assertSame(emptyNavigableSetArray, result); assertTrue(result[0] == null); }
Example 16
Source File: EmptyNavigableSet.java From openjdk-jdk9 with GNU General Public License v2.0 | 3 votes |
/** * Tests that the array has a size of 0. */ @Test(dataProvider = "NavigableSet<?>", dataProviderClass = EmptyNavigableSet.class) public void testToArray(String description, NavigableSet<?> navigableSet) { Object[] emptyNavigableSetArray = navigableSet.toArray(); assertTrue(emptyNavigableSetArray.length == 0, "Returned non-empty Array."); emptyNavigableSetArray = new Object[20]; Object[] result = navigableSet.toArray(emptyNavigableSetArray); assertSame(emptyNavigableSetArray, result); assertTrue(result[0] == null); }
Example 17
Source File: EmptyNavigableSet.java From jdk8u-jdk with GNU General Public License v2.0 | 3 votes |
/** * Tests that the array has a size of 0. */ @Test(dataProvider = "NavigableSet<?>", dataProviderClass = EmptyNavigableSet.class) public void testToArray(String description, NavigableSet<?> navigableSet) { Object[] emptyNavigableSetArray = navigableSet.toArray(); assertTrue(emptyNavigableSetArray.length == 0, "Returned non-empty Array."); emptyNavigableSetArray = new Object[20]; Object[] result = navigableSet.toArray(emptyNavigableSetArray); assertSame(emptyNavigableSetArray, result); assertTrue(result[0] == null); }
Example 18
Source File: EmptyNavigableSet.java From openjdk-jdk8u with GNU General Public License v2.0 | 3 votes |
/** * Tests that the array has a size of 0. */ @Test(dataProvider = "NavigableSet<?>", dataProviderClass = EmptyNavigableSet.class) public void testToArray(String description, NavigableSet<?> navigableSet) { Object[] emptyNavigableSetArray = navigableSet.toArray(); assertTrue(emptyNavigableSetArray.length == 0, "Returned non-empty Array."); emptyNavigableSetArray = new Object[20]; Object[] result = navigableSet.toArray(emptyNavigableSetArray); assertSame(emptyNavigableSetArray, result); assertTrue(result[0] == null); }
Example 19
Source File: EmptyNavigableSet.java From jdk8u60 with GNU General Public License v2.0 | 3 votes |
/** * Tests that the array has a size of 0. */ @Test(dataProvider = "NavigableSet<?>", dataProviderClass = EmptyNavigableSet.class) public void testToArray(String description, NavigableSet<?> navigableSet) { Object[] emptyNavigableSetArray = navigableSet.toArray(); assertTrue(emptyNavigableSetArray.length == 0, "Returned non-empty Array."); emptyNavigableSetArray = new Object[20]; Object[] result = navigableSet.toArray(emptyNavigableSetArray); assertSame(emptyNavigableSetArray, result); assertTrue(result[0] == null); }
Example 20
Source File: EmptyNavigableSet.java From TencentKona-8 with GNU General Public License v2.0 | 3 votes |
/** * Tests that the array has a size of 0. */ @Test(dataProvider = "NavigableSet<?>", dataProviderClass = EmptyNavigableSet.class) public void testToArray(String description, NavigableSet<?> navigableSet) { Object[] emptyNavigableSetArray = navigableSet.toArray(); assertTrue(emptyNavigableSetArray.length == 0, "Returned non-empty Array."); emptyNavigableSetArray = new Object[20]; Object[] result = navigableSet.toArray(emptyNavigableSetArray); assertSame(emptyNavigableSetArray, result); assertTrue(result[0] == null); }