Libraryless. Click here for Pure Java version (4218L/24K).
1 | static <A extends Set<S>> void test_TreeSetDropIn(IF0<A> makeSet, IVF1<A> checkInternalStructure default null) { |
2 | LS list = repF(1000, () -> randomID(3)); |
3 | Set<S> set = asTreeSet(list); |
4 | A cset = makeSet!; |
5 | addAll(cset, set); |
6 | print(set); |
7 | print(cset); |
8 | assertEquals(asList(set), asList(cset)); |
9 | assertEqualsVerbose(l(set), l(cset)); |
10 | |
11 | for (S a : shuffledIterator(list)) { |
12 | set.remove(a); |
13 | cset.remove(a); |
14 | assertEquals(asList(set), asList(cset)); |
15 | assertEqualsVerbose(l(set), l(cset)); |
16 | pcallF(checkInternalStructure, cset); |
17 | } |
18 | } |
Began life as a copy of #1030939
download show line numbers debug dex old transpilations
Travelled to 3 computer(s): bhatertpkbcr, mowyntqkapby, mqqgnosmbjvj
No comments. add comment
Snippet ID: | #1032622 |
Snippet name: | test_TreeSetDropIn [OK] |
Eternal ID of this version: | #1032622/5 |
Text MD5: | 4fd2a127fc84af974402312d579759b2 |
Transpilation MD5: | 828bc2a719b191d93e36cc3a80f0bebd |
Author: | stefan |
Category: | javax |
Type: | JavaX fragment (include) |
Public (visible to everyone): | Yes |
Archived (hidden from active list): | No |
Created/modified: | 2021-09-29 20:49:39 |
Source code size: | 574 bytes / 18 lines |
Pitched / IR pitched: | No / No |
Views / Downloads: | 160 / 249 |
Version history: | 4 change(s) |
Referenced in: | [show references] |