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

15
LINES

< > BotCompany Repo | #1012660 // assertContains

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

Libraryless. Click here for Pure Java version (9622L/53K).

static <A, C extends Collection<A>> C assertContains(C c, A y) {
  ret assertContains(null, c, y);
}

static <A, C extends Collection<A>> C assertContains(S msg, C c, A y) {
  if (!contains(c, y))
    fail((msg != null ? msg + ": " : "") + y + " not contained in " + c);
  ret c;
}

sS assertContains(S a, S b) {
  if (!contains(a, b))
    fail(quote(b) + " not contained in " + quote(a));
  ret a;
}

Author comment

Began life as a copy of #1001055

download  show line numbers  debug dex  old transpilations   

Travelled to 13 computer(s): aoiabmzegqzx, bhatertpkbcr, cbybwowwnfue, cfunsshuasjs, gwrvuhgaqvyk, ishqpsrjomds, lpdgvwnxivlt, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tslmcundralx, tvejysmllsmz, vouqrxazstgt

No comments. add comment

Snippet ID: #1012660
Snippet name: assertContains
Eternal ID of this version: #1012660/8
Text MD5: f53a889b4fec0a9f593ee672fe2dc07e
Transpilation MD5: 03c45bfbe42a4c49f5cfb282693559d1
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2022-11-11 18:36:33
Source code size: 414 bytes / 15 lines
Pitched / IR pitched: No / No
Views / Downloads: 430 / 493
Version history: 7 change(s)
Referenced in: [show references]