Home
last modified time | relevance | path

Searched refs:Collections (Results 1 – 25 of 371) sorted by relevance

12345678910>>...15

/libcore/ojluni/src/test/java/util/Collections/
DMinMax.java32 package test.java.util.Collections;
34 import java.util.Collections;
42 if (!Collections.min(s).equals("x")) in main()
43 throw new RuntimeException("1: " + Collections.min(s)); in main()
44 if (!Collections.max(s).equals("x")) in main()
45 throw new RuntimeException("2: " + Collections.max(s)); in main()
48 if (!Collections.min(s).equals("x")) in main()
49 throw new RuntimeException("3: " + Collections.min(s)); in main()
50 if (!Collections.max(s).equals("y")) in main()
51 throw new RuntimeException("4: " + Collections.max(s)); in main()
[all …]
DWrappedNull.java31 package test.java.util.Collections;
35 import java.util.Collections;
58 Collection c = Collections.unmodifiableCollection(null); in main()
68 Set c = Collections.unmodifiableSet(null); in main()
78 List c = Collections.unmodifiableList(null); in main()
88 Map c = Collections.unmodifiableMap(null); in main()
98 SortedSet c = Collections.unmodifiableSortedSet(null); in main()
108 SortedMap c = Collections.unmodifiableSortedMap(null); in main()
118 Collection c = Collections.synchronizedCollection(null); in main()
128 Set c = Collections.synchronizedSet(null); in main()
[all …]
DWrappers.java30 package test.java.util.Collections;
35 import java.util.Collections;
70 cases.add(new Object[] { Collections.unmodifiableCollection(seedList) }); in collectionCases()
71 cases.add(new Object[] { Collections.unmodifiableList(seedList) }); in collectionCases()
72 cases.add(new Object[] { Collections.unmodifiableList(seedRandomAccess) }); in collectionCases()
73 cases.add(new Object[] { Collections.unmodifiableSet(seedSet) }); in collectionCases()
74 cases.add(new Object[] { Collections.unmodifiableSortedSet(seedSet) }); in collectionCases()
75 cases.add(new Object[] { Collections.unmodifiableNavigableSet(seedSet) }); in collectionCases()
79 cases.add(new Object[] { Collections.unmodifiableMap(seedMap).entrySet() }); in collectionCases()
80 cases.add(new Object[] { Collections.unmodifiableMap(seedMap).keySet() }); in collectionCases()
[all …]
DReverseOrder2.java31 package test.java.util.Collections;
40 import java.util.Collections;
49 check(Collections.reverseOrder() in realMain()
50 == Collections.reverseOrder(null)); in realMain()
52 check(Collections.reverseOrder() in realMain()
53 == reincarnate(Collections.reverseOrder())); in realMain()
55 check(Collections.reverseOrder(Collections.reverseOrder(cmp)) in realMain()
58 equal(Collections.reverseOrder(cmp), in realMain()
59 Collections.reverseOrder(cmp)); in realMain()
61 equal(Collections.reverseOrder(cmp).hashCode(), in realMain()
[all …]
DSyncSubMutexes.java24 package test.java.util.Collections;
152 private static final Collection<String> BASE_COLLECTION = Collections.unmodifiableCollection(
162 BASE_MAP = Collections.unmodifiableMap(map);
167 …instances.add(new Object[] {Collections.synchronizedCollection(new ArrayList<>(BASE_COLLECTION))}); in makeCollections()
175 … instances.add(new Object[] {Collections.synchronizedList(new ArrayList<>(BASE_COLLECTION))}); in makeLists()
176 …instances.add(new Object[] {Collections.synchronizedList(new ArrayList<>(BASE_COLLECTION)).subList… in makeLists()
184 instances.add(new Object[] {Collections.synchronizedSet(new TreeSet<>(BASE_COLLECTION))}); in makeSets()
191 … instances.add(new Object[] {Collections.synchronizedSortedSet(new TreeSet<>(BASE_COLLECTION))}); in makeSortedSets()
192 …instances.add(new Object[] {Collections.synchronizedSortedSet(new TreeSet<>(BASE_COLLECTION)).head… in makeSortedSets()
193 …instances.add(new Object[] {Collections.synchronizedSortedSet(new TreeSet<>(BASE_COLLECTION)).tail… in makeSortedSets()
[all …]
DEmptyCollectionSerialization.java32 package test.java.util.Collections;
44 import java.util.Collections;
88 (Supplier) () -> Collections.EMPTY_LIST}, in makeSingletons()
90 (Supplier) () -> Collections.EMPTY_MAP}, in makeSingletons()
92 (Supplier) () -> Collections.EMPTY_SET}, in makeSingletons()
94 (Supplier) () -> Collections.emptyList()}, in makeSingletons()
96 (Supplier) () -> Collections.emptyMap()}, in makeSingletons()
98 (Supplier) () -> Collections.emptySet()}, in makeSingletons()
100 (Supplier) () -> Collections.emptySortedSet()}, in makeSingletons()
102 (Supplier) () -> Collections.emptySortedMap()}, in makeSingletons()
[all …]
DWrappedUnmodifiableCollections.java30 package test.java.util.Collections;
56 testWrapping(list, Collections::unmodifiableList); in testUnmodifiableListsDontWrap()
62 testWrapping(list, Collections::unmodifiableCollection); in testUnmodifiableCollectionsDontWrap()
72 testWrapping(set, Collections::unmodifiableSet); in testUnmodifiableSetsDontWrap()
78 testWrapping((SortedSet<?>) treeSet, Collections::unmodifiableSortedSet); in testUnmodifiableSetsDontWrap()
81 testWrapping((NavigableSet<?>) treeSet, Collections::unmodifiableNavigableSet); in testUnmodifiableSetsDontWrap()
93 testWrapping(map, Collections::unmodifiableMap); in testUnmodifiableMapsDontWrap()
97 testWrapping((SortedMap<?,?>) treeMap, Collections::unmodifiableSortedMap); in testUnmodifiableMapsDontWrap()
100 testWrapping((NavigableMap<?,?>) treeMap, Collections::unmodifiableNavigableMap); in testUnmodifiableMapsDontWrap()
DCheckedQueue.java31 package test.java.util.Collections;
33 import java.util.Collections;
52 … Queue<String> abq = Collections.checkedQueue(new ArrayBlockingQueue<>(arrayLength), String.class); in testAdd()
79 Queue q = Collections.checkedQueue(abq, String.class); in testAddFail1()
91 Queue q = Collections.checkedQueue(abq, String.class); in testAddFail2()
106 q = Collections.checkedQueue(null, String.class); in testArgs()
113 q = Collections.checkedQueue(abq, null); in testArgs()
120 q = Collections.checkedQueue(null, null); in testArgs()
133 Queue q = Collections.checkedQueue(abq, String.class); in testOffer()
DFindSubList.java30 package test.java.util.Collections;
34 import java.util.Collections;
70 int idx = Collections.indexOfSubList(s, target[i]); in main()
76 if (Collections.indexOfSubList(s,Collections.nCopies(2*s.size(), in main()
82 Collections.reverse(source); in main()
85 Collections.reverse(target[i]); in main()
99 int idx = Collections.lastIndexOfSubList(s, target[i]); in main()
104 if (Collections.indexOfSubList(s,Collections.nCopies(2*s.size(), in main()
DNullComparator.java30 package test.java.util.Collections;
34 import java.util.Collections;
43 Collections.shuffle(list); in main()
57 Collections.sort(tmp, null); in main()
60 if (Collections.binarySearch(tmp, new Integer(69)) != 69) in main()
62 if (!Collections.min(list, null).equals(new Integer(0))) in main()
64 if (!Collections.max(list, null).equals(new Integer(99))) in main()
DNCopies.java24 package test.java.util.Collections;
34 import java.util.Collections;
108 int actualHashCode = Collections.nCopies(size, element).hashCode();
122 …check(equal == Collections.nCopies(pair[0], element).equals(Collections.nCopies(pair[1], element))…
123 …check(equal == Collections.nCopies(pair[0], element).equals(referenceNCopies(pair[1], element)), m…
124 …check(equal == referenceNCopies(pair[0], element).equals(Collections.nCopies(pair[1], element)), m…
127 List<String> nulls = Collections.nCopies(10, null);
128 List<String> nonNulls = Collections.nCopies(10, "non-null");
137 check(Collections.nCopies(0, null).equals(Collections.nCopies(0, "non-null")));
142 List<String> empty = Collections.nCopies(0, "foo");
[all …]
DSer.java31 package test.java.util.Collections;
37 import java.util.Collections;
47 out.writeObject(Collections.EMPTY_SET); in main()
52 if (!Collections.EMPTY_SET.equals(in.readObject())) in main()
61 out.writeObject(Collections.EMPTY_LIST); in main()
66 if (!Collections.EMPTY_LIST.equals(in.readObject())) in main()
75 Set gumby = Collections.singleton("gumby"); in main()
90 List gumbies = Collections.nCopies(50, "gumby"); in main()
DEnumerationAsIterator.java23 package test.java.util.Collections;
38 import java.util.Collections;
55 return of(description, () -> Collections.enumeration(c), exp); in of()
81 Collections.enumeration(new ArrayList<>(Arrays.asList("a")))),
85 Collections.unmodifiableList(new ArrayList<>(Arrays.asList("a"))),
98 () -> wrapInDefault(Collections.emptyEnumeration()),
99 Collections.emptyList()),
102 Collections::emptyEnumeration,
103 Collections.emptyList()),
106 Collections.emptyList(),
[all …]
DSwap.java31 package test.java.util.Collections;
34 import java.util.Collections;
41 List l = new ArrayList(Collections.nCopies(100, Boolean.FALSE)); in main()
44 Collections.swap(l, i, i+1); in main()
46 List l2 = new ArrayList(Collections.nCopies(100, Boolean.FALSE)); in main()
DDisjoint.java32 package test.java.util.Collections;
35 import java.util.Collections;
55 Collections.shuffle(list); in main()
66 if (Collections.disjoint(a, b) != disjoint) in main()
68 if (Collections.disjoint(new HashSet<Integer>(a), b) in main()
71 if (Collections.disjoint(new HashSet<Integer>(a), in main()
DEmptyIterator.java30 package test.java.util.Collections;
33 import java.util.Collections;
42 import static java.util.Collections.emptyEnumeration;
43 import static java.util.Collections.emptyIterator;
44 import static java.util.Collections.emptyList;
45 import static java.util.Collections.emptyListIterator;
46 import static java.util.Collections.emptyMap;
47 import static java.util.Collections.emptySet;
48 import static java.util.Collections.nCopies;
49 import static java.util.Collections.unmodifiableMap;
[all …]
/libcore/harmony-tests/src/test/java/org/apache/harmony/tests/java/util/
DCollections2Test.java29 import java.util.Collections;
62 Collections.sort(lst, null); in test_binarySearchLjava_util_ListLjava_lang_ObjectLjava_util_Comparator()
63 int index = Collections.binarySearch(lst, Integer.valueOf(2), null); in test_binarySearchLjava_util_ListLjava_lang_ObjectLjava_util_Comparator()
75 assertEquals(-1, Collections.binarySearch(localList, new Object())); in test_binarySearchLjava_util_ListLjava_lang_Object()
78 Collections.binarySearch(localList, Integer.valueOf(1)); in test_binarySearchLjava_util_ListLjava_lang_Object()
90 Collections.rotate(new ArrayList<Object>(), 25); in test_rotateLjava_util_ListI()
100 Collections.rotate(list, Integer.MIN_VALUE); in test_rotateLjava_util_ListI()
119 Collections.synchronizedCollection(null); in test_synchronizedCollectionLjava_util_Collection()
132 Collections.synchronizedSortedMap(null); in test_synchronizedSortedMapLjava_util_SortedMap()
145 Collections.synchronizedMap(null); in test_synchronizedMapLjava_util_Map()
[all …]
DCollectionsTest.java36 import java.util.Collections;
267 Collections.binarySearch(null, new Object()); in test_binarySearchLjava_util_ListLjava_lang_Object()
274 .get(i), ll.get(Collections.binarySearch(ll, ll in test_binarySearchLjava_util_ListLjava_lang_Object()
289 Collections.binarySearch(null, new Object(), comp); in test_binarySearchLjava_util_ListLjava_lang_ObjectLjava_util_Comparator()
298 .get(Collections.binarySearch(myReversedLinkedList, in test_binarySearchLjava_util_ListLjava_lang_ObjectLjava_util_Comparator()
316 Collections.copy(null, ll); in test_copyLjava_util_ListLjava_util_List()
322 Collections.copy(ll, null); in test_copyLjava_util_ListLjava_util_List()
335 Collections.copy(al, ll); in test_copyLjava_util_ListLjava_util_List()
358 Collections.copy(ar2, ar1); in test_copyLjava_util_ListLjava_util_List()
373 Collections.copy(mal1, mal2); in test_copyLjava_util_ListLjava_util_List()
[all …]
/libcore/luni/src/test/java/libcore/java/util/
DOldCollectionsTest.java24 import java.util.Collections;
60 Collections.sort(lst, null); in test_binarySearchLjava_util_ListLjava_lang_ObjectLjava_util_Comparator()
61 int index = Collections.binarySearch(lst, Integer.valueOf(2), null); in test_binarySearchLjava_util_ListLjava_lang_ObjectLjava_util_Comparator()
73 Collections.binarySearch(ll, Integer.valueOf(10), null); in test_binarySearchLjava_util_ListLjava_lang_ObjectLjava_util_Comparator()
88 assertEquals(-1, Collections.binarySearch(localList, new Object())); in test_binarySearchLjava_util_ListLjava_lang_Object()
91 Collections.binarySearch(localList, Integer.valueOf(1)); in test_binarySearchLjava_util_ListLjava_lang_Object()
106 Collections.binarySearch(ll, Integer.valueOf(10)); in test_binarySearchLjava_util_ListLjava_lang_Object()
118 Collections.rotate(new ArrayList<Object>(), 25); in test_rotateLjava_util_ListI()
128 Collections.rotate(list, Integer.MIN_VALUE); in test_rotateLjava_util_ListI()
147 Collections.synchronizedCollection(null); in test_synchronizedCollectionLjava_util_Collection()
[all …]
DCollectionsTest.java24 import java.util.Collections;
59 import static java.util.Collections.checkedNavigableMap;
60 import static java.util.Collections.checkedQueue;
61 import static java.util.Collections.synchronizedNavigableMap;
62 import static java.util.Collections.unmodifiableNavigableMap;
78 Enumeration<Object> e = Collections.emptyEnumeration(); in testEmptyEnumeration()
89 testEmptyIterator(Collections.emptyIterator()); in testEmptyIterator()
90 testEmptyIterator(Collections.emptyList().iterator()); in testEmptyIterator()
91 testEmptyIterator(Collections.emptySet().iterator()); in testEmptyIterator()
92 testEmptyIterator(Collections.emptyMap().keySet().iterator()); in testEmptyIterator()
[all …]
/libcore/ojluni/src/test/java/util/stream/test/org/openjdk/tests/java/util/stream/
DSliceOpTest.java67 exerciseOps(Collections.emptyList(), s -> s.skip(0), Collections.emptyList()); in testSkip()
68 exerciseOps(Collections.emptyList(), s -> s.skip(10), Collections.emptyList()); in testSkip()
71 exerciseOps(countTo(1), s -> s.skip(1), Collections.emptyList()); in testSkip()
74 exerciseOps(countTo(100), s -> s.skip(100), Collections.emptyList()); in testSkip()
75 exerciseOps(countTo(100), s -> s.skip(200), Collections.emptyList()); in testSkip()
89 exerciseOps(Collections.emptyList(), s -> s.limit(0), Collections.emptyList()); in testLimit()
90 exerciseOps(Collections.emptyList(), s -> s.limit(10), Collections.emptyList()); in testLimit()
91 exerciseOps(countTo(1), s -> s.limit(0), Collections.emptyList()); in testLimit()
93 exerciseOps(countTo(100), s -> s.limit(0), Collections.emptyList()); in testLimit()
102 exerciseOps(Collections.emptyList(), s -> s.skip(0).limit(0), Collections.emptyList()); in testSkipLimit()
[all …]
/libcore/luni/src/test/java/libcore/android/compat/
DCompatibilityTest.java27 import java.util.Collections;
88 ChangeConfig config = new ChangeConfig(Collections.emptySet(), Collections.emptySet()); in testGetDisabledChangesArray()
90 config = new ChangeConfig(Collections.emptySet(), Collections.singleton(5L)); in testGetDisabledChangesArray()
92 config = new ChangeConfig(Collections.emptySet(), in testGetDisabledChangesArray()
99 ChangeConfig config = new ChangeConfig(Collections.emptySet(), Collections.emptySet()); in testGetEnabledChangesArray()
101 config = new ChangeConfig(Collections.singleton(5L), Collections.emptySet()); in testGetEnabledChangesArray()
104 Collections.emptySet()); in testGetEnabledChangesArray()
/libcore/ojluni/src/main/java/sun/util/locale/
DUnicodeLocaleExtension.java35 import java.util.Collections;
56 attributes = Collections.emptySet(); in UnicodeLocaleExtension()
57 keywords = Collections.singletonMap(key, value); in UnicodeLocaleExtension()
65 this.attributes = Collections.emptySet(); in UnicodeLocaleExtension()
70 this.keywords = Collections.emptyMap(); in UnicodeLocaleExtension()
92 if (attributes == Collections.EMPTY_SET) { in getUnicodeLocaleAttributes()
95 return Collections.unmodifiableSet(attributes); in getUnicodeLocaleAttributes()
99 if (keywords == Collections.EMPTY_MAP) { in getUnicodeLocaleKeys()
100 return Collections.emptySet(); in getUnicodeLocaleKeys()
102 return Collections.unmodifiableSet(keywords.keySet()); in getUnicodeLocaleKeys()
/libcore/ojluni/src/main/java/java/security/cert/
DPKIXRevocationChecker.java29 import java.util.Collections;
103 private List<Extension> ocspExtensions = Collections.<Extension>emptyList();
104 private Map<X509Certificate, byte[]> ocspResponses = Collections.emptyMap();
105 private Set<Option> options = Collections.emptySet();
173 ? Collections.<Extension>emptyList() in setOcspExtensions()
184 return Collections.unmodifiableList(ocspExtensions); in getOcspExtensions()
199 this.ocspResponses = Collections.<X509Certificate, byte[]>emptyMap(); in setOcspResponses()
235 ? Collections.<Option>emptySet() in setOptions()
246 return Collections.unmodifiableSet(options); in getOptions()
/libcore/luni/src/test/java/libcore/java/net/
DCookiesMCompatibilityTest.java24 import java.util.Collections;
38 Map<String, List<String>> responseHeaders = Collections.singletonMap("Set-Cookie", in testCookiesWithoutLeadingPeriod()
39 Collections.singletonList("a=b; domain=chargepoint.com")); in testCookiesWithoutLeadingPeriod()
55 Map<String, List<String>> responseHeaders = Collections.singletonMap("Set-Cookie", in testCookiesWithLeadingPeriod()
56 Collections.singletonList("b=c; domain=.chargepoint.com;")); in testCookiesWithLeadingPeriod()
63 assertEquals(Collections.singletonList("b=c"), cookieList); in testCookiesWithLeadingPeriod()

12345678910>>...15