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

15
LINES

< > BotCompany Repo | #1024001 // test_restructure_syncLinkedList (OK)

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

Transpiled version (5094L) is out of date.

svoid test_restructure_syncLinkedList() {
  LS orig = synchronizedList(litlinkedlist("a", "b"));
  print(structure(orig));
  LS ll = cast restructure(orig);
  assertEquals(orig.getClass(), ll.getClass());
  assertTrueVerbose(unwrapSynchronizedList(ll) instanceof LinkedList);
  assertEqualsVerbose(orig, ll);

  // legacy format
  L l2 = cast unstructure("syncLL[1, 2]");
  assertEquals(synchronizedList(litlinkedlist()).getClass(), l2.getClass());
  assertTrue(unwrapSynchronizedList(l2) instanceof LinkedList);
  assertEquals(ll(1, 2), l2);

}

Author comment

Began life as a copy of #1023894

download  show line numbers  debug dex  old transpilations   

Travelled to 6 computer(s): bhatertpkbcr, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tvejysmllsmz, vouqrxazstgt

No comments. add comment

Snippet ID: #1024001
Snippet name: test_restructure_syncLinkedList (OK)
Eternal ID of this version: #1024001/6
Text MD5: c1c3197ee8604f6db88360d62cbec314
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2022-08-21 04:35:37
Source code size: 559 bytes / 15 lines
Pitched / IR pitched: No / No
Views / Downloads: 235 / 366
Version history: 5 change(s)
Referenced in: [show references]