Not logged in.  Login/Logout/Register | List snippets | | Create snippet | Upload image | Upload data

10
LINES

< > BotCompany Repo | #1034800 // test_UniquifyUsingHasher

JavaX fragment (include) [tags: use-pretranspiled]

Libraryless. Click here for Pure Java version (20640L/125K).

1  
svoid test_UniquifyUsingHasher() {
2  
  UniquifyUsingHasher<S, Int> u = new(s -> l(s));
3  
  int n = 1000, maxL = 10;
4  
  LS l = repF(n, -> randomOverAlphabet("ab", random(maxL)));
5  
  print(takeFirst(10, l));
6  
  LS expected = uniquify(l);
7  
  LS actual = u.addAll(l)!;
8  
  print(n + " => " + l(expected));
9  
  assertListsEqual(expected, actual);
10  
}

download  show line numbers  debug dex  old transpilations   

Travelled to 4 computer(s): bhatertpkbcr, ekrmjmnbrukm, mowyntqkapby, mqqgnosmbjvj

No comments. add comment

Snippet ID: #1034800
Snippet name: test_UniquifyUsingHasher
Eternal ID of this version: #1034800/4
Text MD5: 2ae7957707579549ab7f389637e0b74d
Transpilation MD5: 8ba60c6ad3f285947a8ba46215f2d578
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2022-03-10 19:24:34
Source code size: 340 bytes / 10 lines
Pitched / IR pitched: No / No
Views / Downloads: 138 / 205
Version history: 3 change(s)
Referenced in: [show references]